各位好: 我在学VC6时遇到一下问题:
我声明了一个CRichEditCtrl类的对象m_richEdit,但在cpp 文件中调用其内部函数
GetSelectionCharFormat()时:m_richEdit.GetSelectionCharFormat(charFormat);编译时总是出现错误入下:// error C2664: 'GetSelectionCharFormat' : cannot convert parameter 1 from 'struct CCommonView::_charformat' to 'struct _charformat &'
A reference that is not to 'const' cannot be bound to a non-lvalue
//我理解的意思好像是不能将GetSelectionCharFormat()的参数charFormat改为指针类型,但我自己改为指针类型还是不对!其中charFormat是CHARFORMAT结构的对象
我的CHARFORMAT结构定义如下:typedef struct _charformat
{
UINT cbSize;
DWORD dwMask;
DWORD dwEffects;
LONG yHight;
LONG yOffset;
COLORREF crTextColor;
BYTE bCharSet;
BYTE bPitchAndFamily;
TCHAR szFaceName[LF_FACESIZE];
}CHARFORMAT;请各位指教
我声明了一个CRichEditCtrl类的对象m_richEdit,但在cpp 文件中调用其内部函数
GetSelectionCharFormat()时:m_richEdit.GetSelectionCharFormat(charFormat);编译时总是出现错误入下:// error C2664: 'GetSelectionCharFormat' : cannot convert parameter 1 from 'struct CCommonView::_charformat' to 'struct _charformat &'
A reference that is not to 'const' cannot be bound to a non-lvalue
//我理解的意思好像是不能将GetSelectionCharFormat()的参数charFormat改为指针类型,但我自己改为指针类型还是不对!其中charFormat是CHARFORMAT结构的对象
我的CHARFORMAT结构定义如下:typedef struct _charformat
{
UINT cbSize;
DWORD dwMask;
DWORD dwEffects;
LONG yHight;
LONG yOffset;
COLORREF crTextColor;
BYTE bCharSet;
BYTE bPitchAndFamily;
TCHAR szFaceName[LF_FACESIZE];
}CHARFORMAT;请各位指教
解决方案 »
- 求教 BitBlt贴镂空图和游戏地图的完整代码·
- MFC编写程序遇到错误'getaddrinfo' : undeclared identifier,求解
- 为什么我用ATL创建的服务只能用当前用户启动可以正常工作,以SYSTEM用户启动就不可以?
- 文本滚动
- 灵异问题,绝对灵异,MFC的ACTIVEX
- 懂或者用过Packet32开发包的人请你帮帮我。
- rich edit 的用法请教,15分已经是我的全部拉
- 自己看程序,发现了几个不太明白的地方,请各位讲下
- 关于网络传输速率的控制问题!
- ×××找《UML用户指南》或《UML参考手册》的英文版×××
- 救命啊。谁会这个问题!!!!!!!!!!!!!!
- 本人最近需要把一段C++语言的程序翻译成DELPHI,可惜没学过C,各位帮我翻译一下,谢谢!
m_richEdit.GetSelectionCharFormat(&charFormat);