What is IUnknown? Explain some of commonly used methods provided by IUnknown.

What is IUnknown? Explain some of commonly used methods provided by IUnknown. Explain message routing and message loop.

What is IUnknown? Explain some of commonly used methods provided by IUnknown.

IUnknown is the base interface for every COM class. Through all this COM interfaces are derived. It uses three methods which are as follows:

QueryInterface() which explores the feature

AddRef() which includes the object life time management and it increments the object reference count

Release() also takes part in object life time management and it decrements the object reference count

Explain message routing and message loop.

A visible window on screen has to go through many functions and phases before the show. It contains functions like CreateWindow and ShowWindow and functions other than that also. When window gets displayed on the screen then it has to make itself ready to take the control of keyboard and mouse which will be given by the user. The system maintains a message queue for each program currently running on the system. When any input occurs, the system translates this event into a message and places into the system message queue. A program receives that message from the message queue and executes the block of code this is known as message loop. And passing the message from one process to another is called message routing. This is done by passing the exact message to the process which wants to be executed at the time of execution.
What is the use of message map? Advantages of a message map.
Any system is a message driven system. Every event has to be noted down and stored somewhere like a mouse click or a printer signal sends a message to the running application which in turn handles the.........
Difference between ASSERT and VERIFY.
ASSERT reads and evaluates an expression when the program is in debug mode and it throws an exception if the result is 0 and program terminates whereas VERIFY reads..........
What is the base class for MFC Framework?
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.............
Post your comment