__RTDynamicCast

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at __RTDynamicCast.

Runtime implementation of the dynamic_cast operator.

PVOID __RTDynamicCast (  
   PVOID inptr,   
   LONG VfDelta,  
   PVOID SrcType,  
   PVOID TargetType,   
   BOOL isReference  
   ) throw(...)  

Parameters

inptr
Pointer to a polymorphic object.

VfDelta
Offset of virtual function pointer in object.

SrcType
Static type of object pointed to by the inptr parameter.

TargetType
Intended result of cast.

isReference
true if input is a reference; false if input is a pointer.

Pointer to the appropriate sub-object, if successful; otherwise, NULL.

bad_cast() if the input to dynamic_cast<> is a reference and the cast fails.

Converts inptr to an object of type TargetType. The type of inptr must be a pointer if TargetType is a pointer, or an l-value if TargetType is a reference. TargetType must be a pointer or a reference to a previously defined class type, or a pointer to void.

RoutineRequired header
__RTDynamicCastrtti.h
Show: