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 |
1)How to change the size of a button at run time ?
What is the difference between Extension DLL and Regular DLL?
1)set the Title for The File DialogBox, in MFC?
What is document-view architecture ? Give me one real time example for SDI ?
Difference between Cclint DC & Cpaint Dc
Explain about MDI and CMultiDocTemplate ?
List out the basic features of MFC.
If application hangs while SendMessage is waiting for the result, how you handle it?
What are the differences between MFC Exception macros and C++ exception keywords?
Does the application have more than one object? If Yes, Briefly explain.
I can i set size of integer variable should be fixed for different operating systems(Ex i want integer size is 2bytes in OS)
What types of threads are supported by MFC framework?