在VC对话框项目中往主对话框窗口上添个richedit控件,
那编译执行时会自动退出程序,没有任何异常,退出码也是0,调试也没有错误提示。
除了添了一个richedit控件外,我没有改向导生成的任何东西!
是不是范了什么低级错误,或是我的VC安装有问题,还请高手自己亲手试过之后再回答我的问题,谢谢!

解决方案 »

  1.   

    AfxInitRichEdit
    BOOL AFXAPI AfxInitRichEdit( );ResCall this function to initialize the rich edit control for the application. It will also initialize the common controls library, if the library hasn’t already been initialized for the process. If you use the rich edit control directly from your MFC application, you should call this function to assure that MFC has properly initialized the rich edit control runtime. If you use rich edit via CRichEditCtrl, CRichEditView, or CRichEditDoc, you don't need to call this function.
      

  2.   

    你在使用了RichEdit控件之后,应该在CMyAPP::InitInstance初始化函数中初始化RichEdit控件,就是加上上面说得这个函数啦:AfxInitRichEdit()
      

  3.   

    还有为什么我问了另一位朋友,他说他未添加
    AfxInitRichEdit();
    一样工作正常,这是为什么,请高手指教新手!
      

  4.   

    呵呵,MSDN上就是这样说的,而且事实证明这样做可以解决问题。具体为什么讲不清楚,但某名人讲过,不求甚解也是种好的学习态度啊!
      

  5.   

    如果在工程初期设置了支持ole的话 就不用写这个了