c++ SDK
LVITEM item = {0};
item.mask = LVIF_TEXT; // 文字
item.cchTextMax = MAX_PATH; // 文字长度
item.iItem = 0;
item.iSubItem = 0;
item.pszText = str;
// item.puColumns = 0;
// item.piColFmt = 0;
SendMessage(list, LVM_INSERTITEM, 0, (LPARAM)&item);
调试程序到最后一句时程序就没有反应了
item里面有puColumns和piColFmt这两个东西无法读取内存,我觉得问题应该是出在这上面吧
下面是msdn的东西
typedef struct {
UINT mask;
int iItem;
int iSubItem;
UINT state;
UINT stateMask;
LPTSTR pszText;
int cchTextMax;
int iImage;
LPARAM lParam;
#if (_WIN32_IE >= 0x0300)
int iIndent;
#endif
#if (_WIN32_WINNT >= 0x0501)
int iGroupId;
UINT cColumns;
UINT puColumns;
#endif
#if (_WIN32_WINNT >= 0x0600)
int piColFmt;
int iGroup;
#endif
} LVITEM, *LPLVITEM;
=======================================================================
有人知道这两个参数怎么设置吗?或者告诉我一个可行的方法吧~
还有就是如果我改版本的话会怎样?可不可以跳过 #if (_WIN32_WINNT >= 0x0501)这种判定啊?