如果界面上丢一个richedit控件,还什么都没做呢,那么按运行按钮,就是那个惊叹号,则程序无法启动,只有删掉这个控件,程序才可以正常启动,进入WINDOWS界面。有没有人知道原因?

解决方案 »

  1.   

    App类的InitInstance函数中加上AfxInitRichEdit()/AfxInitRichEdit2();
      

  2.   

    Caution: 
    If you are using a rich edit control in a dialog box (regardless whether your application is SDI, MDI, or dialog-based) , you must call AfxInitRichEdit once before the dialog box is displayed. A typical place to call this function is in your program's InitInstance member function. You do not need to call it for each time you display the dialog box, only the first time. You do not have to call AfxInitRichEdit if you are working with CRichEditView. 
     
      

  3.   

    正解写在 app的inistance即可
      

  4.   

    App类的InitInstance函数中加上AfxInitRichEdit()/AfxInitRichEdit2();