Name
DispCallByIDProc Variable
Syntax
var DispCallByIDProc: Pointer;
type
PDispRec = ^TDispRec;
TCallDesc = packed record
CallType: Byte;
ArgCount: Byte;
NamedArgCount: Byte;
Args: array[0.255] of Byte;
end;
TDispDesc = packed record
Dispid: Integer;
ResultType: Byte;
CallDesc: TCallDesc;
end;
procedure CallProc(Result: Pointer; const Dispatch: IDispatch;
DispDesc: PDispDesc; Params: Pointer); cdecl;
DispCallByIDProc := @CallProc;Description
Delphi
calls the DispCallByIDProc procedure to call a
dispatch method that is identified by dispatch identifier in a
dispinterface. Delphi fills the
DispDesc record with the necessary information
about the dispatch identifier and the method’s formal
parameters. Params points to the actual arguments
for the method call. The procedure must store the result in the
memory buffer pointed to by Result. The type of
Result’s buffer is dictated by the dispatch
descriptor.
The default value of DispCallByIDProc is a
procedure that raises runtime error 17
(EVariantError).
Tips and Tricks
The
ComObjunit setsDispCallByIDProcto a procedure that implements the necessary code to callIDispatch.Invoke.ComObjalso declares theTCallDescandTDispDesctypes.Writing your own
DispCallByIDProcis a major undertaking. Consult the ComObj.pas source code to learn how.
See Also
| Cdecl Directive, Dispid Directive, Dispinterface Keyword, IDispatch Interface, VarDispProc Variable |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access