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

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  


how u can move CDC pointer to one line in cview?

2 Answers  


Can you explaing the relashionship between document,frame and view ?

2 Answers  


In SDI how many view's are attached to document object and in MDI how many view's are attached to Document object?

2 Answers   Wipro,


What is #progma and where it is used?

5 Answers   L&T,


what is functioning of DIalodDataXchange ..?

0 Answers  


what are the feauters of CObject

4 Answers   Siemens, Wipro,


What are the differences between MFC Exception macros and C++ exception keywords?

2 Answers  


In VC++ How to transfer between one exe to another exe while running..

5 Answers   Wipro,


Which Macro is a Super set of other two macro DECLARE_SERIAL,DECLARE_DYNAMIC and DECLARE_DYNCREATE. ?

2 Answers   Sony,


1)How to change the size of a button at run time ?

1 Answers  


What is the base class for MFC Framework ?

2 Answers   Mphasis,


Categories