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

What is primitive and non-primitive application?

2 Answers   HCL,


How WM_PAINT message gets called in MFC,please explain it . a)Who calls the WM_PAINT message? b)When it gets called? c)how it comes to message queue? Please Explain it

8 Answers  


What is the difference between the Encapsulation and Abstraction

25 Answers   HCL, Invensys, TCS, Wipro,


What is a message map?

1 Answers   Mphasis,


How to handle RTTI in MFC ?

1 Answers  


How do you change the properties for a tree view control that is part of the CTreeView class?

1 Answers  


If there is more than 100 control in a window how we can change the Taborder of a controls

4 Answers   Satyam,


What is socket?

3 Answers  


What function is used to disable a control at runtime?

7 Answers  


1) create ToolTip in MFC?

2 Answers   HCL,


What is #progma and where it is used?

5 Answers   L&T,


What is Multithreading

1 Answers   Invensys,


Categories