RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomVariantType.DispInvoke Method

Invokes a method call when the Variant supports such operations.

Pascal
procedure DispInvoke(Dest: PVarData; const Source: TVarData; CallDesc: PCallDesc; Params: Pointer); virtual;
C++
virtual __fastcall DispInvoke(PVarData Dest, const TVarData Source, PCallDesc CallDesc, void * Params);

When the application tries to call a method, set a property, or read a property using a Variant of the custom Variant type, the system automatically generates a call to DispInvoke. TCustomVariantType responds by generating a system error indicating an invalid dispatch attempt. 

To create a custom Variant type that allows applications to call methods or use properties, use TInvokeableVariantType as a base class instead of TCustomVariantType. TInvokeableVariantType introduces methods for executing method calls and implementing properties, and overrides the DispInvoke method so that it dispatches method calls to the appropriate methods. 

Dest is a TVarData record that receives the return value of any function calls. 

Source is the TVarData record that holds the data from the custom Variant whose property or method was invoked. 

CallDesc identifies the method that was called, including the type and number of its arguments. 

Params points to an array of parameter values that were passed in the method call. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!