CWinApp::OnFileNew

If enabled, this method handles execution of the File New command.

afx_msg void OnFileNew( ); 

Remarks

You must add an

ON_COMMAND( ID_FILE_NEW, OnFileNew )

statement to your CWinApp class message map to enable this method.

Example

// The following message map, produced by AppWizard, binds the
// File New, Open, and Print Setup menu commands to default
// framework implementations of these commands.
BEGIN_MESSAGE_MAP(CMyApp, CWinApp)
   //{{AFX_MSG_MAP(CMyApp)
   ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
      // NOTE - the ClassWizard will add and remove mapping macros here.
      //    DO NOT EDIT what you see in these blocks of generated code!
   //}}AFX_MSG_MAP
   // Standard file based document commands.
   ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
   ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
   // Standard print setup command.
   ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()

// The following message map illustrates how to rebind the
// File New, Open and Print Setup menu commands to handlers that
// you implement in your CWinApp-derived class. You can use
// ClassWizard to bind the commands, as illustrated below, since
// the message map entries are bracketed by //{{AFX_MSG_MAP
// and //}}AFX_MSG_MAP.  Note, you can name the handler
// CMyApp::OnFileNew instead of CMyApp::OnMyFileNew, and likewise
// for the other handlers, if desired.
BEGIN_MESSAGE_MAP(CMyApp, CWinApp)
   //{{AFX_MSG_MAP(CMyApp)
   ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
   ON_COMMAND(ID_FILE_NEW, OnMyFileNew)
   ON_COMMAND(ID_FILE_OPEN, OnMyFileOpen)
   ON_COMMAND(ID_FILE_PRINT_SETUP, OnMyFilePrintSetup)
   //}}AFX_MSG_MAP
END_MESSAGE_MAP()

Requirements

**  Windows CE versions:** 1.0 and later
  Header file: Declared in Afxwin.h
  Platform: H/PC Pro, Palm-size PC, Pocket PC

See Also

CWinApp::OnFileOpen