生成一个对话框程序,为什么CMyapp::InitInstance函数返回FALSE,系统自己写的!
InitInstance函数返回FALSE是创建失败啊!不明白!谁能解释一下啊?谢谢大家帮忙了!

解决方案 »

  1.   

    返回FALSE是因为程序要结束了
      

  2.   

    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的
      

  3.   

    基于对话框程序是返回 FALSE 的 :)