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 Multithreading
What is the use of message map ?
Which MFC function is used to display output?
how does conditionally close the Dialog Box ?
1)To Remove WS_MINIMIZEBOX in a Frame ?
Have you ever used win32 APIs ?
visual Pogramming c++ coding for create a paint application.. (Please someone help me)
what message is sent to an application when the user presses the primary button?
What is subclassing?
is there any class which is not derived from Cobject
What is CArchive class dowes?
What is the base class for MFC Framework ?