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.我明白你的意思了. 你加AfxInitRichEdit之后再试一试.
to syy64(太平洋): 试了,不行
to ydfivy(花生薄脆饼): 非常感谢 在C*App类的InitInstance()里加上AfxInitRichEdit()以后就可以了 注意不能在紧挨return前一句加,最好加在InitInstance()最前面还想问一下,在RichEdit类里显示一个字符串是什么啊?
2 重载了PreCreateWindow而且返回False也会导致弹出“建立空文档失败”
3 在OnCreate 里面返回-1 也会导致弹出“建立空文档失败”。看看你的LOADFRAME有没有出错.
OnFileNew()函数试试。
你加AfxInitRichEdit之后再试一试.
试了,不行
非常感谢
在C*App类的InitInstance()里加上AfxInitRichEdit()以后就可以了
注意不能在紧挨return前一句加,最好加在InitInstance()最前面还想问一下,在RichEdit类里显示一个字符串是什么啊?
改变字体的大小和颜色的函数是什么?再次谢谢你的快速耐心回答
UpdateDate(false); CHARFORMAT cf;
COLORREF t = RGB(0, 200, 200);
m_r.GetDefaultCharFormat(cf);
cf.yHeight = 500;
cf.crTextColor = t;
m_r.SetDefaultCharFormat(cf);
COLORREF c= RGB(200, 200, 200);
m_r.SetBackgroundColor(false, c);
m_r.SetBackgroundColor(false, c);大小可以改变,颜色没有改变,什么地方错了?
COLORREF t = RGB(0, 200, 200);
m_r.GetDefaultCharFormat(cf);
cf.dwEffects = CFE_PROTECTED; //设置这个.
cf.yHeight = 500;
cf.crTextColor = t;
m_r.SetDefaultCharFormat(cf);
COLORREF c= RGB(200, 200, 200);
m_r.SetBackgroundColor(false, c);
m_r.SetBackgroundColor(false, c);
这样就好了.变色了.
以解决