Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
We recommend using Visual Studio 2017

DYNAMIC_DOWNCAST

 

Provides a handy way to cast a pointer to a pointer to a class object while checking to see if the cast is legal.


DYNAMIC_DOWNCAST(
class
, 
pointer )

class

The name of a class.

pointer

A pointer to be cast to a pointer to an object of type class.

The macro will cast the pointer parameter to a pointer to an object of the class parameter's type.

If the object referenced by the pointer is a "kind of" the identified class, the macro returns the appropriate pointer. If it is not a legal cast, the macro returns NULL.

Requirements

Header: afx.h

Show: