为什么我的MFC对话框里添加了个rich edit运行就自动退出了?

Jenf_Mu 2012-05-08 12:15:21
有个MFC对话框程序,原来没事,现在想添加个rich edit控件,就是把控件拖到程序上,然后运行,程序一运行就退出了,为什么?
...全文
233 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
BombZhang 2012-05-08
  • 打赏
  • 举报
回复
在对话框上直接使用RichEdit控件时,在对话框的DoModal()之前需要先调用AfxInitRichEdit()

MSDN:

BOOL AFXAPI AfxInitRichEdit( );

Remarks

...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.
BombZhang 2012-05-08
  • 打赏
  • 举报
回复
初始化函数你搞了吗?没有这个会退出
Jenf_Mu 2012-05-08
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 的回复:]

不太可能吧
你再把这个控件删除运行试试?
[/Quote]
删了就没事,加进来就又自动退出,要不我把这个程序发出来,大家瞧瞧?
BombZhang 2012-05-08
  • 打赏
  • 举报
回复
不太可能吧
你再把这个控件删除运行试试?
liliboy9527 2012-05-08
  • 打赏
  • 举报
回复
楼上正解

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧