我在VC中创建了一个DLL作为Win32项目
DLLMAIN函数是
BOOL APIENTRY DllMain( HMODULE hModule,DWORD ul_reason_for_call,LPVOID lpReserved ) { return TRUE; }
现在我需要HINSTANCE的DLL,需要传递给Win32函数.
HMODULE和HINSTANCE是否相同?
如何获得HINSTANCE?
本书摘自Windows Via C/C++ [1]
Note As it turns out,HMODULEs and HINSTANCEs are exactly the same thing. If the documentation for a function indicates that an HMODULE is required,you can pass an HINSTANCE and vice versa. There are two data types because in 16-bit Windows HMODULEs and HINSTANCEs identified different things
[1] Richter,Jeffery和Nasarre,Christophe,Windows Via C/C++,5th ed,Redmond:Microsoft Press 2008,pp.74