What is the base class for MFC Framework?

What is the base class for MFC Framework? What are the main features provided by CObject class? What is CALLBACK? How it work? What is the advantage of CALLBACK?

What is the base class for MFC Framework? What are the main features provided by CObject class?

CObject class is the main base class for MFC Framework. It is the mother of all other classes. Almost all classes in MFC are derived from CObject one of the exception is CString. It provides several important features such as

Serialization - conversion of object to a series of bytes that can be written to disk and brought back later to restore your object to its previous state.
1) Runtime type information
2) Debugging features
3) Object diagnostic output
4) Compatibility with collection classes

What is CALLBACK? How it work? What is the advantage of CALLBACK? Explain with an example.

Callback is a function that is called from a function pointer. If you pass a pointer as an argument to another function and another function calls back the previous function it is called as CALLBACK. The main advantage of this is to detach caller from the callee. In this caller doesn’t care about the callee but caller knows that there is some callee exists with some prototype and with some functionality in hand. So it provides and abstraction. For example, if suppose you write a library program that provides implementation of all sorting algorithms. But you don’t want to put any sorting logic into your functions by yourself and making it more general to use. You want client to make decision of the algorithm they want to use. So, for this the function pointers will be used which will be making callbacks.
Difference between GetMessage, PostMessage & PeakMessage.
GetMessage() function takes the message to the message queue and make a procedure call. Then it waits for a message to be placed..............
How to handle dynamic menus in MFC? What happens when client calls CoCreateInstance?
MFC got built in function to handle dynamic menus. It comes after the message maps. By overriding ...........
45 Perl Interview Questions and Answers - Freshers, Experienced
Perl interview questions and answers for freshers and experienced - Explain Perl. When do you use Perl for programming?, What are the advantages of programming in Perl?, What factors do you take into consideration to decide if Perl is a suitable programming language for a situation?
Post your comment