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

How to hide Dialog at start time?

Status
Not open for further replies.

sulacco

Technical User
Nov 8, 2002
74
RU
Hi, People. Maybe it's stupid question but How to hide Dialog at start up time? The app is dialog based.
 
Nope, it didn't work my app is dialog based, MFC.
 
OK, I think the best thing would be to not make it modal then. Make it a member of your app's class (a pointer)

Code:
CMyDialog* m_pDlg;

then in your initinstance do something like this:

Code:
m_pDlg = new CMyDialog;
m_pDlg->Create(IDD_MYDIALOG,this);
m_pDlg->ShowWindow(SW_HIDE);

instead of the call to DoModal and declaring it as a local variable. Make sure it's public so that anywhere in your code you can reference it by (theApp.m_pDlg). Just make sure you delete it in your app's InitInstance function.

BlackDice

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top