The information in this article applies to:
SUMMARYSometimes it is preferable not to initially open a new document in an MFC application. To implement this behavior on Windows, you can remove the call to OnFileNew() or ParseCommandLine() from InitInstance. On the Macintosh, you need to override CWinApp::CreateInitialDocument(). This article describes how to accomplish these behaviors. MORE INFORMATIONIn a Windows MFC application, a new document is initially created if the Command Line is empty. Since Macintosh applications do not have Command Lines, the open application Apple Event is sent to the application and is handled by _AfxOpenAppHandler(), which calls CreateInitialDocument() to open a new document:
When a new document is not needed, you can override CreateInitialDocument()
and have it return TRUE. This is desirable to prevent the file type dialog
from appearing in applications supporting multiple document types:
REFERENCESSee "Creating Initial Documents" in the Macintosh Porting Guide within the Online Documentation. Additional query words: WM_MACINTOSH WLM_MACEVENT
Keywords : kbDocView kbMAC kbMFC kbVC MacPrgIss |
Last Reviewed: February 2, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |