I have the class. It's built. I'm using MSVC++. I'm using MFC. How do I display my new dialog box? What do I call?
I have the class. It's built. I'm using MSVC++. I'm using MFC. How do I display my new dialog box? What do I call?
"If you tell the truth, you don't have to remember anything"
-Mark Twain
int result;
YourDialogClass dlg;
result = dlg.DoModal();
hth
-nv
She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."
When in doubt, read the FAQ.
Then ask a smart question.
Have you seen this?
This is where the About dialog is called. But on to your question. Luckily I have this from the old Message board.Code:CAboutDlg dlgAbout; dlgAbout.DoModal();
By an anonymous person:
Create a class for the dialog box.
Ex If the name of the dialog is "CMyDialog",
In the mainframe create button in the drop down menus and then add a function for the button.
In the function construct a CMyDialog object.
Ex. CMyDialog dlg;
Then call DoModal();
dlg.DoModal();
Remember to include the header file for the dialog in the mainframe class......
#include "MyDialog.h"
So if you created a button with a caption of "Test" then the function for Left Buttohn clicked to bring up the dialog will be
CMainFrame::OnTest()
{
CMyDialog dlg;
dlg.DoModal();
}
C++ Is Powerful
I use C++
There fore I am Powerful