g_hinstance has the DLL handle.

BOOL APIENTRY DllMain(
HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved)
{
switch(ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
g_hInstance = (HINSTANCE)hModule;
break;

case DLL_PROCESS_DETACH:
break;
}
return(TRUE);
}

And, this is also being used the window I created.

wndclass.hInstance = g_hInstance

Can I do this? Can the dll handle be used for both the window and the dialog?