VC入门级问题

jasochen 2003-11-10 11:28:23
一个基于对话框的程序,开始用Edit Box控件IDC_EDIT1,m_text,编译运行成功,后来在资源窗口
把EDIT BOX 换为RICH EDIT 控件 ID还是IDC_EDIT1,m_text,编译成功,为什么不能运行?
...全文
30 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
yintongshun 2003-11-10
  • 打赏
  • 举报
回复
你的应用程序App类的初始化函数InitInstance()函数中加入:
AfxInitRichEdit();
就可以运行了,祝你成功!
hanwg 2003-11-10
  • 打赏
  • 举报
回复
在app程序中InitInstance()加入:
AfxInitRichEdit();
初始化RichEdit对象
bluebohe 2003-11-10
  • 打赏
  • 举报
回复
CRichEditCtrl


A “rich edit control” is a window in which the user can enter and edit text. The text can be assigned character and paragraph formatting, and can include embedded OLE objects. Rich edit controls provide a programming interface for formatting text. However, an application must implement any user interface components necessary to make formatting operations available to the user.

The CRichEditCtrl class provides the functionality of the rich edit control. This Windows Common control (and therefore the CRichEditCtrl class) is available only to programs running under Windows 95 and Windows NT versions 3.51 and later.

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.

For more information on using CRichEditCtrl, seeControl Topics andUsing CRichEditCtrl in the Visual C++
syl5005 2003-11-10
  • 打赏
  • 举报
回复
帮你顶
spwnihao 2003-11-10
  • 打赏
  • 举报
回复
你先把对话框中的CEdit m_text,删除
然后再通过,ClassWarizd加入richedit
因为在加入richedit的时候会倒入相应的文件
bluebohe 2003-11-10
  • 打赏
  • 举报
回复
首先,这不关系到之前的操作,只要你放进来RICH EDIT 控件,就不能运行,我一会给你找原因
vcforever 2003-11-10
  • 打赏
  • 举报
回复
在你的应用程序初始化函数InitInstance()函数中加入:
AfxInitRichEdit();
你的程序就可以运行了,祝你成功!
ayanamiwww 2003-11-10
  • 打赏
  • 举报
回复
AfxInitRichEdit();
就是这个,就像使用Socket 之前要调用AfxSocketInit()一样。
我还有分吗?

16,551

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • AIGC Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

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