[Dev-C++] Question about handles and DLLs...
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <mr...@c2...> - 2002-02-08 08:56:40
|
One question: A DLL receives a HINSTANCE handle in it's DLLMain function that is invoked when the DLL is mapped into an application. If I load a DLL with LoadLibrary, LoadLibrary returns a HINSTANCE handle to the DLL. I was under the impression that this handle would be the same as the handle that the DLL itself receives in DLLMain, but it seems to be different. Is this some MingW error, or is this correct behaviour? Reason I ask is that if I try to set a hook with SetWindowsHookEx, and use the HINSTANCE that the DLL itself receives, the hook does not work. If I supply the HINSTANCE that LoadLibrary returned, then it works just fine. In both cases SetWindowsHookEx returns a valid handle to the hook, but only in the latter case the hook is actually installed to the system... -=D8yvind --------------------------------- mr...@c2... @ work |