int GetLength() const throw()
{
return( GetData()->nDataLength );
}
struct CStringData
{
IAtlStringMgr* pStringMgr; // String manager for this CStringData
int nDataLength; // Length of currently used data in XCHARs (not including terminating null)
int nAllocLength; // Length of allocated data in XCHARs (not including terminating null)
long nRefs; // Reference count: negative == locked
// XCHAR data[nAllocLength+1] // A CStringData is always followed in memory by the actual array of character data
}
我是使用Rich Edit 2.0这个控件,想要得到这里面字符串的长度,但感觉老有问题
Rich Edit 2.0 的最大长度是多少?
解决方案 »
- 如何在CRichEdit中显示一个真分数
- VC开发一个OCX控件,在EDIT控件基础上二次开发,我怎么得到这个EDIT控件的控制变量呢?
- 如何读bmp文件的象素及显示?、
- 求助各位高手:关于SMTP,POP3,FTP数据包分析的测试
- Unicode文本读取
- Win2000 AS、VC6中,SystemParametersInfo(SPI_SETSCREENSAVERRUNNING,TRUE,NULL,0)为何不能开启屏保功能?
- 一个奇怪的ADO问题
- 关于MFC LISTBOX右键菜单无法响应的问题,请指教~
- VC的Output(输出窗口)突然不能停靠,只能最大化和最小化,怎么还原到原始状态啊。。
- 超级高深的问题 100分奉上
- MFC 遍历文件名写入数组
- MFC非模态对话窗相应按钮点击事件时控件忽然失效
long GetLimitText( ) const;Return ValueThe current text limit, in bytes, for this CRichEditCtrl object.ResCall this member function to get the text limit for this CRichEditCtrl object. The text limit is the maximum amount of text, in bytes, the rich edit control can accept.
// otherwise only 0xFFFFF=1048575 bytes can be show!
GetEditCtrl().SetLimitText(0x00400000);
CRichEditCtrl::GetTextLength()
如果是多字节字符集,返回的是字串的字节数(如“中国123”,返回7)
如果是Unicode则返回的字符数(如“中国123”,返回5)