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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Missing It 1

Status
Not open for further replies.

jimjake

Technical User
Oct 30, 2004
25
US
Is there somewhere out there a simple sample of a SDI project that
has a simple dialog box that initializes when the program starts.
I am missing it, I don’t understand how to create an instance to make
The Dialog pop. One of your best programmers suggested that I skip the exercise in the book and go on. This weekend I read the whole book and I still do not understand. Maybe there is a program that I could download to help me……….. Jim
 
Well since an SDI is centered around the document, you'd prolly best deal with the various document related events etc that occur.

For instance you can ovverride your document's OnNewDocument to do whatever, like displaying a dialog.

Since a new document is instantiated when your app starts (by default, but you can modify that behavior too), that way you'd pop up a dialog when the app is started.

/Per
[sub]
"It was a work of art, flawless, sublime. A triumph equaled only by its monumental failure."[/sub]
 
The quick, dirty way to do what you want would be to use the View class.
Create a dialog resource and hit Ctrl-W. Name your class whatever you like and accept the default Dialog base class.
Now go to your View class OnInitialUpdate function. Declare a variable of your dialog class, for instance: CNewDlg nDlg;
nDlg.DoModal();
This will create a dialog that opens with the application.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top