I have a dll in which I create a Popup Window. In the code for
creating the window I must supply an HINSTANCE to both the
WNDCLASS definition and in the call to CreateWindow().
I am not sure if I should use the HINSTANCE of the main app (which
I send to the dll through a function call), or if I should use the
hModule handle which I get from the DllMain call:
BOOL APIENTRY DllMain( HANDLE hModule,
From what I understand the hModule HANDLE is the same
as an HINSTANCE. When I use the hModule I simply cast it to
Both techniques seem to work and I don't notice any performance
differences, but I want to make sure I am doing the right thing.
Also, I would prefer to use the hModule of the DLL
so that the main app does not need to pass in it's HINSTANCE.
What is the proper method?