Re: How a non-windowed program can receive WM_DEVICECHANGE from Wi

Tech-Archive recommends: Fix windows errors by optimizing your registry



hInstance is an instance handle of the main exe or DLL which contains the
WNDPROC. When that DLL is unloaded, all classes registered for its HINSTANCE
are automatically unregistered.

"Amanda Lin" <AmandaLin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:ADAE70C5-DB74-4604-B71E-F3CDB0F8678F@xxxxxxxxxxxxxxxx
Thank you very much.

I have a question about the "hInstance" that RegisterClass() needs to
create
my own window class.

typedef struct _WNDCLASS {
...
HINSTANCE hInstance;
...
} WNDCLASS, *PWNDCLASS;

MSDN says it's "Handle to the instance that contains the window procedure
for the class". Is it the handle of the application or the thread I
created ?





.



Relevant Pages

  • Re: using exe as dll
    ... LoadLibrary fails to load the DLL properly (the entrypoint is never ... BOOL __stdcall _DllMainCRTStartup(HINSTANCE hInstance, DWORD dwReason, PVOID ... int __cdecl WinMainCRTStartup; ...
    (microsoft.public.win32.programmer.kernel)
  • afxMapHWND with Shared Release DLL
    ... Everything works fine in DEBUG mode. ... return CreateDlgIndirect(lpDialogTemplate, m_lpParent, hInstance); ... Also I can STATICALLY link the MFC DLL to the program... ... nafxcw.lib; second definition ignored ...
    (microsoft.public.vc.mfc)
  • FAO J Navia
    ... following is the stack dump for the errors. ... I am also giving the code for the dll along with this mail... ... DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) ... If this Extension DLL is being implicitly linked to by ...
    (comp.lang.c)
  • Re: FAO J Navia
    ... following is the stack dump for the errors. ... I am also giving the code for the dll along with this mail... ... DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) ... If this Extension DLL is being implicitly linked to by ...
    (comp.lang.c)
  • Re: HOWTO Get HINSTANCE in a ATL - DLL
    ... The HINSTANCE is available in the _Module global object which is initialised ... > I'm trying to make a DLL with ATL that support all of the various COM ... I also tried to get the HINSTANCE at the DllMain ... Surely ATL is holding the HINSTANCE ...
    (microsoft.public.vc.atl)