为什么不能用iDescription?
2009-03-20 16:06
176 查看
最近做监听短消息,提取文本的一个功能。出了一件怪事:用于提取短信内容的iDescription怎么也不能将文本完整的获得,只能读取一部分的内容。
没办法,只好用这种获取短消息内容的方法:
TPtrC description(iMsvEntry->ChildDataL(iNewMessageId).iDescription);//打印出的内容总是只有一部分。
没办法,只好用这种获取短消息内容的方法:
iMsvEntry->SetEntryL(iNewMessageId); // Open the store, read-only CMsvStore* store = iMsvEntry->ReadStoreL(); CleanupStack::PushL(store); if (store->HasBodyTextL()) { CParaFormatLayer* iParaFormatLayer = CParaFormatLayer::NewL(); CCharFormatLayer* iCharFormatLayer = CCharFormatLayer::NewL(); CRichText* richText = CRichText::NewL(iParaFormatLayer, iCharFormatLayer); CleanupStack::PushL(richText); store->RestoreBodyTextL(*richText); const TInt length = richText->DocumentLength(); TBuf<128> buf(0); richText->Extract(buf);//这样子,才能完整的读取。是什么原因呢? CleanupStack::PopAndDestroy(richText);
相关文章推荐
- 为什么你不能在 MySQL 3.x 版本上安装 Joomla 1.5.23
- 为什么C++编译器不能支持对模板的分离式编译
- java中interface中的方法为什么不能是static方法?
- 为什么你工作3年依旧不能月薪过万
- 为什么构造函数不能为虚函数
- 为什么int型的数组用memset不能清零(memset的使用规范)
- 为什么手机通话就不能不要钱?
- 为什么Dijkstra算法不能处理带负权边的图
- DDL为什么不能rollback?
- lock为什么只能锁定引用不能锁定值类型
- 为什么构造函数不能虚而析构函数可以虚,以及在什么情况下来使用析构函数
- 为什么能上QQ而不能上网
- 为什么 Windows2003 的 IIS6.0 不能上传超过 200K 的文件?
- 子类为什么不能重写父类的静态方法
- 为什么静态方法中不能调用动态方法?
- 为什么C++赋值运算符重载函数不能被继承?
- Python - 在定义函数时,为什么默认参数不能放在必选参数前面?
- 为什么delegate属性要用assign不能用retain?
- PADS覆铜地线为什么不能连在一起呢?
- 为什么在我的电脑上不能看chm格式的文件