Click to See Complete Forum and Search --> : [RESOLVED] dll creating window?


james2432
June 25th, 2009, 10:02 AM
I was wondering how to go about doing this...
I have a dll that calls a c++ class that creates a window using WinAPI

I've been fallowing this guide:
http://msdn.microsoft.com/en-us/library/bb384843.aspx

but I do not have "hInstance" seeing as it's in a class and it's not in WinMain()

is it possible to pass null to the hInstance? if not how do we create a new one?

hoxsiew
June 25th, 2009, 01:02 PM
You will have an HINSTANCE passed to DllMain by the OS. Make a global HINSTANCE variable and set it in DllMain() then you can use it wherever you need it in the dll.