我在一个对话框中加了一个Rich Edit控件,一运行显示不出来。后来查找MSDN说是要加一个BOOL AFXAPI AfxInitRichEdit( )函数初始化。于是我把它加在CTestApp::InitInstance()中,但是还是显示不出来。请问我错在哪了.......
请各位帮帮忙。

解决方案 »

  1.   

    AfxInitRichEdit();
    加在CTestApp::InitInstance()中,放在函数的第一句。
      

  2.   

    AfxInitRichEdit();
    把这句话放到
    CTestApp::InitInstance();
    里,创建对话框代码的前面应该不会错的
      

  3.   

    我把它放到第一句了,也显示不出来。
    我是弄了一个基于对话框,只加了一个控件(Rich Edit)的应用。
    一运行什么都没有。
    我把它原版考下来:
    BOOL CTestApp::InitInstance()
    {
    BOOL AFXAPI AfxInitRichEdit( );//就是这一行
    AfxEnableControlContainer();#ifdef _AFXDLL
    Enable3dControls(); // Call this when using MFC in a shared DLL
    #else
    Enable3dControlsStatic(); // Call this when linking to MFC statically
    #endif CTestDlg dlg;
    m_pMainWnd = &dlg;
    int nResponse = dlg.DoModal();
    if (nResponse == IDOK)
    {
    // TODO: Place code here to handle when the dialog is
    //  dismissed with OK
    }
    else if (nResponse == IDCANCEL)
    {
    // TODO: Place code here to handle when the dialog is
    //  dismissed with Cancel
    } // Since the dialog has been closed, return FALSE so that we exit the
    //  application, rather than start the application's message pump.
    return FALSE;
    }
      

  4.   

    不好意思,我弄出来了。但不明白为什么BOOL AFXAPI AfxInitRichEdit( );就不对。
    删掉前面的BOOL AFXAPI就能显示出来????
    这是这是什么原因了???