| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Creates a call template for an external DLL function.
DllPrepareCall( <cDllFile>|<nDllHandle>, ;
[<nCallingConvention>] , ;
<cFuncName>|<nOrdinal> ) --> pCallTemplate
Calling conventions
| Constant | Value | Description |
|---|---|---|
| DC_CALL_CDECL | 0x0010 | C calling convention (__cdecl) |
| DC_CALL_STD *) | 0x0020 | Standard convention for WinAPI (__stdcall) |
| *) default | ||
The function returns a pointer to the call template for the specified DLL function.
Function DllPrepareCall() prepares a call template which contains all information required to invoke a DLL function, except for the parameters to pass. The call template is then passed along with the parameters to function DllExecuteCall() which executes the DLL function (see DllExecuteCall() for a complete example).
The preparation of a call template is advantageous when a DLL function must be called many times, since the information assembled in the call template is the same for multiple DLL function calls. If a DLL function needs to be called only once or a few times, it can be executed via DllCall() since the extra overhead of the call template preparation is not justified in such case.
Important: the call template must not be changed.
| See also: | DllExecuteCall(), FreeLibrary(), GetProcAddress(), GetLastError(), LoadLibrary() |
| Category: | DLL functions , xHarbour extensions |
| Source: | rtl\dllcall.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
http://www.xHarbour.com