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 functioning of DIalodDataXchange ..?
What function is used to disable a control at runtime?
What is the difference between the SDI and MDI
What function is used to retrieve the currently selected index in a list box?
Name the Synchronization objects?
What is the difference between GetMessage and PeekMessage ?
What is the command routing in MFC framework?
Difference between Cclint DC & Cpaint Dc
What?s the difference between Modal and Modeless Dialog?
what are the feauters of CObject
Tell me the different controls in MFC ?
Which MFC function is used to display output?