listview的消息LVM_GETITEM的小问题

supersuperhunter 2012-03-15 09:34:11
发现msdn中写着用这个消息获取item或者subitem的文本时,控件有可能不会将文本存到指定的位置,而是改变的指针变量指向一个新的位置
原文如下
If the LVIF_TEXT flag is set in the mask member of the LVITEM structure, the pszText member must point to a valid buffer and the cchTextMax member must be set to the number of characters in that buffer. Applications should not assume that the text will necessarily be placed in the specified buffer. The control may instead change the pszText member of the structure to point to the new text rather than place it in the buffer.

我想知道在什么情况下那种特殊情况会发生,因为现在要改得话有点麻烦,而且暂时还没出现过问题
...全文
48 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
获取文本应该用LVM_GETITEMTEXT

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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