<< Return to Main Index

< Return to Class Index

CGXControl::IsKindOf

BOOL IsKindOf(const CGXControlClass* pClass) const;

BOOL IsKindOf(const CRuntimeClass* pRuntimeClass) const;

pClass

A pointer to the CGXControlClass structure associated with your CGXControl-derived class.

pRuntimeClass

A pointer to a CRuntimeClass structure associated with your CWnd-derived class.

Return Value

TRUE if the object corresponds to the class; otherwise FALSE.

Remarks

Tests pClass to see if (1) it is an object of the specified class or (2) it is an object of a class derived from the specified class.

The first function works only for classes declared with the GRID_DECLARE_CONTROL macro.

The second function works only if the control is derived from CWnd and the class is declared with the GRID_DECLARE_DYNAMIC macro. Otherwise it will return FALSE.

Do not use this function extensively, because it defeats the Visual C++ polymorphism feature. Use virtual functions instead.

See Also

CGXControl::GetControlClass CGXControl::GetRuntimeClass CGXControl::GetWndPtr

CGXControl

Class Overview | Class Members