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

about the view every time the MDI-application is run

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Dear

every time i run a MDI application

it shows a blank document

how can i avoid this??
 
Yoou should implement what do you want to show. John Fill
1c.bmp


ivfmd@mail.md
 
When you create a MDI app using the AppWizard. the Appwizard creates code by default to create a new document on application startup.

To avoid this (sometimes it can be a pain) you have to modify code in the InitInstance() function of your CWinApp derived object.

You will see code like this :
Code:
	// Parse command line for standard shell commands, DDE, file open
	CCommandLineInfo cmdInfo;
	ParseCommandLine(cmdInfo);

	// Dispatch commands specified on the command line
	if (!ProcessShellCommand(cmdInfo))
		return FALSE;

Change this block of code as shown below
Code:
	// Parse command line for standard shell commands, DDE, file open
	CCommandLineInfo cmdInfo;
	ParseCommandLine(cmdInfo);

	// Dispatch commands specified on the command line
	if (cmdInfo.m_nShellCommand == CCommandLineInfo::FileNew)
		cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
	if (!ProcessShellCommand(cmdInfo))
		return FALSE;

That should stop the app creating a new document everytime it starts up.

Hope this helps
Alistair :)I
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top