procedure TForm1.Button2Click(Sender: TObject);
type
TProcedure = procedure; stdcall;
var
vHandle: THandle;
begin
vHandle := LoadLibrary(cFileNameLibrary);
try
TProcedure(GetProcAddress(vHandle, PChar(22)));
finally
FreeLibrary(vHandle);
end;
end;
//---------------------------------------------------
The GetProcAddress function returns the address of the specified exported dynamic-link library (DLL) function.
FARPROC GetProcAddress(
HMODULE hModule, // handle to DLL module
LPCSTR lpProcName // name of function
);
Parameters
hModule
Identifies the DLL module that contains the function. The LoadLibrary or GetModuleHandle function returns this handle.
lpProcName
Points to a null-terminated string containing the function name, or specifies the function's ordinal value. If this parameter is an ordinal value, it must be in the low-order word; the high-order word must be zero.
it must be in the low-order word; the high-order word must be zero.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~