GetModuleHandle
Description
Returns the handle of the PBX that contains the native class. This
method is required to allow the PowerBuilder VM to determine which PBXs
can be unloaded.
Syntax
|
1 |
GetModuleHandle( ) |
Return value
pbulong
Examples
This code in the implementation of a marshaler class returns the
handle of the PBX:
|
1 2 3 4 5 |
extern pbulong thisModuleHandle; pbulong SampleMarshaler::GetModuleHandle() { return thisModuleHandle; } |
The handle is set in the main module:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
pbulong thisModuleHandle = 0; BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { thisModuleHandle = (pbulong)hModule; switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } return TRUE; } |
Usage
You must implement this method in the marshaler native
class.
See also
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest