Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to handle RTTI in MFC ?



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

Post New Answer

More MFC Interview Questions

Hi All, I have created one MFC Dialog Based application.now if i am running the application its working fine,instead of closing he application i minimized the application,if i run the application again,i am getting the Dialog. I want to prevent the calling of application multiple times. please give me the code and let me know in which method i need to make changes. Praveer

7 Answers   HP,


What is the difference between Extension DLL and Regular DLL?

6 Answers   GE,


how do u identify RTTI in vc++

4 Answers   Siemens,


how to repaint when working with horizontal scroll bar

0 Answers  


Tell me about different kinds of synchranization objects ?

6 Answers  


1)why we cant create more than one instance of the class Derived from CWinApp

5 Answers   Alstom,


1)How to load an icon on a button as Dynamically ?

1 Answers   HCL,


Types of DLL's

11 Answers   Invensys,


If i derive a new class from CObject what are the basic features my derived wil get ?

4 Answers   Microsoft,


Why Array Index starts from Zero

30 Answers   HCL,


What is #progma and where it is used?

5 Answers   L&T,


What function is called by a document class to notify views that the document has been changed?

2 Answers  


Categories