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 |
List out the basic features of MFC.
What is the difference between workrer thread and UI thread
What are the differences between MFC Exception macros and C++ exception keywords?
What are the special requirements for dialog box resources used in a form view?
WHAT IS DIFFERENT BETWEN RELEASE MODE & DEBUGGING MODE
4 Answers Google, Microsoft, TCS,
What is the difference between regular dlls and extended dlls?
How can server communicate with more than one client
Hi can anyone explain about the synchronization objects types and where we are using in the code.
How to update windows title bar dynamically?
In SDI how many view's are attached to document object and in MDI how many view's are attached to Document object?
In VC++ How to transfer between one exe to another exe while running..
How can we create thread in MFC framework?