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 is the difference between ASSERT and VERIFY?
Does the application have more than one object? If Yes, Briefly explain.
How many types of combo box are their
2 Answers Aaditya Info Solutions, E Logic,
i have created runtime menu -- ( admistrator ->managepackage,manage module). but now i want to open a dialog when i select manage package and any other diaolg when selecting manage module ( whole selection is at run time only ) . Please HELP .its urgently required
how does conditionally close the Dialog Box ?
1)How to change a text of a button as Dynamically?
How to update windows title bar dynamically?
how do u identify RTTI in vc++
1)How to create ToolTip in MFC?
Does the application have more than one object? If no, then what is the reason?
what is the use of CCmdTarget?
How do I create a dialog box in mfc?