InitInstance 里调用AfxInitRichEdit。

解决方案 »

  1.   

    CYourApp::InitInstance里,创建主窗口前调用AfxInitRichEdit();
      

  2.   

    Important   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.   

    嗯???我的程序的在CYourApp::InitInstance里没有AfxInitRichEdit();
    呀,为什么我用Crichedit就没来呢????
      

  4.   

    InitInstance 添加这一句AfxInitRichEdit();就可以了。
      

  5.   

    嗯???我的程序的在CYourApp::InitInstance里没有AfxInitRichEdit();
    呀,为什么我用Crichedit就没事呢????
      

  6.   

    是CRichEditView吧,它在CRichEditView::PreCreateWindow里自己调用了AfxInitRichEdit.