我首先生成了一个基于对话框的应用程序,然后再其中的对话框上放置了一个RichEditCtrl,编译,运行,没有任何反应,进行调试发现,当程序执行到 int nResponse = dlg.DoModal();时,直接跳到return false;
不是是VC版本的问题,还是操作系统的问题,还是程序的问题,不知各位大虾有没有遇到类似的情况,希望大家给与帮助!

解决方案 »

  1.   

    App::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.