Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie need help - DLL to display a dialog box

Status
Not open for further replies.

Cas1

Programmer
Feb 8, 2006
1
AU
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top