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 command routing in MFC framework?
What is document-view architecture ? Give me one real time example for SDI ?
What is the difference between ASSERT and VERIFY?
What interface must be supported by an ActiveX control?
Explain about MDI and CMultiDocTemplate ?
What is the base class for MFC Framework ?
What is model and modeless dialog box ? Give some examples?
Explain the flow of SDI application?
If there is more than 100 control in a window how we can change the Taborder of a controls
What is the base class for MFC
What is the use of CCmdTarget ?
1)does Frame Thickness in MFC?