softyan
asked on
How to get an instance handle?
Does anyone know that how to get the instance handle inside a dll using win32? Please help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If this would work in a .EXE I see no reasong why it should not in a DLL.
ASKER
I have tried out in and EXE and it worked but not in a dll. Could you pls tell me that how to display a dialog box inside a dll?
Remember that the instance identifies the executable where the dialog box resource resides. Does it reside in the DLL or in the EXE?
hwnd should also be the appropriate window handle from your application.
The API help does not say that this cannot be done.
Raymond
hwnd should also be the appropriate window handle from your application.
The API help does not say that this cannot be done.
Raymond
ASKER
When i compile my dll, i compile with the dialog box resource, does this means that the dialog box resource reside in the dll?
The hwnd is the handle of the application which calling this dll. It this the right way?
The hwnd is the handle of the application which calling this dll. It this the right way?
You can check this by opening the DLL as resources in Studio.
It sounds as though you are doing things right to display the dialog - I can't really offer any other suggestions at the moment.
Raymond.
It sounds as though you are doing things right to display the dialog - I can't really offer any other suggestions at the moment.
Raymond.
ASKER
I still cannot find out the way to display a dialog box resource from a dll. Anyway this is your point.
ASKER
DialogBox(GetModuleHandle(