How to handle RTTI in MFC ?
Answer / n.venkateshwara rao.
RTTI (Run Time Type Identification) in MFC can be handled
by using the class CRunTimeClass.
But CRunTimeClass can be use to identify the type of the
class which are derived from CObject.
For eg -
void MyFunction()
{
CObject *mObject = new MyClass;
if(mObject->IsKindOf(RUNTIME_CLASS( MyClass) ) )
{
printf("Class is of type MyClass\n");
}
else
{
printf("Class is of type someotherclass\n");
}
}
We can use "type_info" for other type of classes which are
not derived from CObject.
Is This Answer Correct ? | 15 Yes | 1 No |
What function is used to disable a control at runtime?
How to handle RTTI in MFC ?
1)why we cant create more than one instance of the class Derived from CWinApp
How can server communicate with more than one client
How we can findout Memoryleaks, In what way it can be avoided
1)At run-time, you can change the icon by calling the LoadIcon() function?
is there any class which is not derived from Cobject
Which MFC function is used to display output?
How can we create thread in MFC framework?
what is the use of AFX_MANAGE_STATE ?
What is socket?
How to handle dynamic menus in mfc? What happens when client calls cocreateinstance?