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

Preventing a new document opening on start up of exe

Status
Not open for further replies.

classT

Programmer
Oct 6, 2002
19
0
0
US
Hi, I have a multi-document project which, when launched, automatically opens a new document. This is obviously because of the settings I put in when I created the project.

However, I would like the user to determine whether this happens on launch through options/preferences. Only problem is, I can't find the piece of code in my project which creates the new document on launch so I can decide whether or not to intercept it depending on the user's options.

Can anybody help?
 
In your CWinApp derived class, locate the InitInstance() function definitions. Within the function, look for the lines:
Code:
    CCommandLineInfo cmdInfo;
    ParseCommandLine(cmdInfo);

Change it to:
Code:
    CCommandLineInfo cmdInfo;
Code:
    cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
Code:
    ParseCommandLine(cmdInfo);

HTH
Shyan
 
GREAT! that was exactly what I was looking for... THANKS!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top