Hi,
I'm a C++ newbie having lots of trouble trying to get a DLL function to display a dialog box.
I'm using VC++ 6.0 and I originally created a dialog based application project. The project/dialog all worked fine. But then I needed place the application in a DLL. So first I created a DLL to just display a message using MessageBox. This all seemed to work fine and I can call the function in the DLL from C++ and other languages and it displays the message box correctly.
The problem I have is trying to display my dialog box from the function in the DLL.
I've tried calling the original app pretty much as is:
CDialogApp App;
App.InitInstance();
but this crashes with an Assert.
I also tried merging the code from the CDialogApp into the DLL function:
CMyDialog Dialog;
Dialog.doModal();
This runs ok but nothing gets displayed.
Does anyone have some sample code that works. What I need is a DLL containing a function that displays a dialog box.
Thanks to anyone who can help me out.
EC
I'm a C++ newbie having lots of trouble trying to get a DLL function to display a dialog box.
I'm using VC++ 6.0 and I originally created a dialog based application project. The project/dialog all worked fine. But then I needed place the application in a DLL. So first I created a DLL to just display a message using MessageBox. This all seemed to work fine and I can call the function in the DLL from C++ and other languages and it displays the message box correctly.
The problem I have is trying to display my dialog box from the function in the DLL.
I've tried calling the original app pretty much as is:
CDialogApp App;
App.InitInstance();
but this crashes with an Assert.
I also tried merging the code from the CDialogApp into the DLL function:
CMyDialog Dialog;
Dialog.doModal();
This runs ok but nothing gets displayed.
Does anyone have some sample code that works. What I need is a DLL containing a function that displays a dialog box.
Thanks to anyone who can help me out.
EC