|
-
May 19th, 1999, 10:04 PM
#1
Which message maps/function should I use to create a dialog/window automatically when apps starts up
Can anybody provide me a source code in VC++5.0, which will create a MDI window and a dialog box automatically when the application starts up. I have some problem in doing that. I could'n figure out in what function/message map I can write that piece of code, wherever I do that, the window always getting covered by View window in one way or the other. Any help or clue is most welcome.
Senior Consultant Cap Gemini America,LLC
-
May 19th, 1999, 10:22 PM
#2
Re: Which message maps/function should I use to create a dialog/window automatically when apps start
Do following:
Create new project "sam", choose MDI in Step 1. Click finish
Create Dialod you want to display when app start.
In samApp class
Include "Dialog.h"
In InitInstance()
{
CDialog *dlg = new CDialog();
dlg->Create(CDialog::IDD);
dlg->ShowWindow(SW_SHOW);
// when you want show MDI call dlg->DestroyWindow();
}
LB_TMA
-
May 20th, 1999, 02:08 AM
#3
Re: Which message maps/function should I use to create a dialog/window automatically when apps start
If you use DoModal instead of ShowWindow it will insure your dialog will stay on top of your main window.
-
May 20th, 1999, 09:13 PM
#4
Re: Which message maps/function should I use to create a dialog/window automatically when apps start
Sorry. But you use ShowWindow that mean you use Modalless, MDI continue work while the Dialog show. Use DoModal the program will wait untill Dialog hide to continue.
LB_TMA
-
May 20th, 1999, 09:52 PM
#5
Re: Which message maps/function should I use to create a dialog/window automatically when apps start
Not to mention that
BOOL CTestApp::InitInstance()
{
AfxEnableControlContainer();
CDtest dlg; //add this line
dlg.DoModal();//and this line
works as well
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|