Maptitude GISDK Help |
Loads a DLL and returns a handle that can be used in function calls.
Added in Version 6.0/2012.
dllhandle = LoadLibrary(string dll_name [, array options])
Argument |
Contents |
dll_name |
The name of the Dynamic Link Library (DLL) |
Option |
Type |
Contents |
StdCall |
Boolean |
If "true" assumes the _stdcall calling convention, where arguments are passed on the stack and the called function is responsible for removing them off the stack; default is "false" |
FastCall |
Boolean |
If "true" assumes the _fastcall calling convention, where some arguments are passed in registers and the called function is responsible for popping other arguments off the stack; default is "false" |
Cdecl |
Boolean |
Assumes the _cdecl calling convention, where the arguments are passed on the stack and the and the calling function is responsible for removing them off the stack; defaultis "true" |
Return Type |
String |
Can be "double", "int" or "string" |
A DLL handle.
The options array is an optional argument.
The dll remains loaded until the variable is discarded.
In 64-bit programs the calling convention option is ignored, since all 64-bit programs use the equivalent of the FastCall calling convention.
In a 32-bit environment, all Standard Windows API functions use StdCall.
// You can use this to hook into Windows API. Take for an example:
//
// int MessageBox(HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType)
//
// declared in user32.dll. You would actually call the MessageBoxA version with
hDll = LoadLibrary("user32.dll")
args = {{"long",0},{"char *","Hello World"},{"char *","My Title"},{"long",0}}
opts.StdCall = "True"
opts.[Return Type] = "long"
ret = hDll.MessageBoxA(args, opts)
Error Type |
Meaning |
Error |
An invalid parameter was specified |
NotFound |
The DLL or one of its required components was not found or could not be loaded |
Function |
Summary |
Calls a function in a Dynamic Link Library (DLL) |
|
Starts a Windows program |
|
Open a document, executable, or URL with the appropriate program |
©2025 Caliper Corporation | www.caliper.com |