BOOL CMyApp::InitInstance() { // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need. SetDialogBkColor(); // Set dialog background color to gray LoadStdProfileSettings(); // Load standard INI file options (including MRU) // Register the application's document templates. Document templates // serve as the connection between documents, frame windows and views. CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CMyDoc), RUNTIME_CLASS(CMainFrame), // main SDI frame window RUNTIME_CLASS(CMyView)); AddDocTemplate(pDocTemplate); // create a new (empty) document OnFileNew(); if (m_lpCmdLine[0] != '\0') { // TODO: add command line processing here } return TRUE; } 这是MSDN上的例子,你说的是不是当发生某一非预期的事件时候结束程序啊,一阿办成功的话是返回TRUE的
{
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need. SetDialogBkColor(); // Set dialog background color to gray
LoadStdProfileSettings(); // Load standard INI file options (including MRU) // Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views. CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CMyDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CMyView));
AddDocTemplate(pDocTemplate); // create a new (empty) document
OnFileNew(); if (m_lpCmdLine[0] != '\0')
{
// TODO: add command line processing here
} return TRUE;
}
这是MSDN上的例子,你说的是不是当发生某一非预期的事件时候结束程序啊,一阿办成功的话是返回TRUE的