我想通过RichEdit控件来显示一个文本文件内容,当我在Dialog中插入一个
RichEdit控件后,执行时报“创建新文档失败”的错误。
应该如何做呢?

解决方案 »

  1.   

    AfxInitRichEdit loads RICHED32.DLL to initialize version 1.0 of the rich edit control. To use version 2.0 and 3.0 of the rich edit control, RICHED20.DLL needs to be loaded. This is accomplished with a call to AfxInitRichEdit2. If you have dialog resources with the rich edit control created prior to Visual C++ .NET, the rich edit controls are automatically version 1.0. Rich edit controls inserted using the Visual C++ .NET Resource Editor are version 2.0.To update rich edit controls in existing Visual C++ applications to version 2.0, open the .RC file as text, change the class name of each rich edit control from "RICHEDIT" to "RichEdit20a". Then replace the call to AfxInitRichEdit with AfxInitRichEdit2.
      

  2.   

    To masterz(MS MVP) 
    照你的方法做了,还是报同样的错误。
      

  3.   

    在程序初始化的地方加上这条语句试试:
    AfxInitRichEdit();