Hi all,
Can someone provide an example on how to show a Dialog Box from within a dll without using MFC?
Thanks in advance.
Regards,
tonyxxy
Hi all,
Can someone provide an example on how to show a Dialog Box from within a dll without using MFC?
Thanks in advance.
Regards,
tonyxxy
Showing a Modal Dialog Box from a regular WIN32 exe works perfect. However when I try to create a Dialog Box from within a dll, the Dialog doesn't appear at all. I really don't know what I could been doing wrong, so a simple example would be highly appreciated.
Thanks again.
Regards,
tonyxxy
The only difference is you call LoadLibrary() on the DLL containing the dialog resource and use the return value from LoadLibrary() as the hInstance parameter to any of the dialog creation functions.
gg
So if I understand you right, HINSTANCE is needed when creating a Dialog Box from within a dll? How come the following works in a usual WIN32 exe?
DialogBox(NULL,(LPCTSTR)IDD_ABOUTBOX,NULL, (DLGPROC)About);
Sorry if I'm asking stupid questions, but I'm quite new to all this.
Regards,
tonyxxy
When you specify NULL, the system loads the resource from the process's executable image - the .exe file. If the dialog resource does not reside with in the running exe file, you'll have to provide a non-NULL hInstance.
If the DLL is already loaded into your address space, you can use GetModuleHandle() instead of LoadLibrary()/FreeLibrary().
gg
It worked
Thanks again for helping me out
Regards,
tonyxxy
That was tonyxxy's last post to this website - back in 2004.
Instead of posting to a 4+ year old thread. Start a brand new thread of your own with specific details of the issues you are having, or questions you'd like answered.
But at least you searched the forums first - so you got that going for you...
gg