我的对话框加了CRichEditCtrl控件以后,就不能显示了,这是为什么?

解决方案 »

  1.   

    CRichEditCtrl 是通用库comctl32.dll 中的控件,
    你没有初始化通用库,请调用 InitCommonControls 即可解决。
      

  2.   

    对话框初始化的时候加一句
    AfxInitRichEdit( );
      

  3.   

    在你的工程中的CYourApp的InitInstance()中加入://YourApp.cpp  BOOL CYourApp::InitInstance()
      {
            AfxInitRichEdit( );//add
            .........
      }
      

  4.   

    MSDN的重要说明: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.
      

  5.   

    add AfxInitRichEdit() function in your CXXApp::InitInstance() function !
      

  6.   

    惭愧这么多人知道答案。对话框内不能加,我一直是用CREATE建立的。
      

  7.   

    怎么在SDI中创建一个视图
    然后放一个CRichEdit控件呐