I have this code:
<code>
HWND hList = GetDlgItem(hDlg, IDC_LIST_CHARACTERS);
LVCOLUMN column;
// character
column.mask = LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM;
column.pszText = "Character name";
column.cx = 200;
column.iSubItem = 1;
SendMessage(hList, LVM_INSERTCOLUMN, 0, (LPARAM)&column);
// number of bones
column.mask = LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM;
column.pszText = "Number of Bones";
column.cx = 90;
column.iSubItem = 2;
SendMessage(hList, LVM_INSERTCOLUMN, 0, (LPARAM)&column);
LVITEM item;
item.mask = LVIF_TEXT|LVIF_;
item.pszText = "This is a test";
item.iItem = 0;
item.iSubItem = 1;
SendMessage(hList, LVM_INSERTITEM, 0, (LPARAM)&item);
item.mask = LVIF_TEXT;
item.pszText = "asdasdasdasd";
item.iItem = 1;
item.iSubItem = 2;
SendMessage(hList, LVM_INSERTITEM, 0, (LPARAM)&item);
</code>
When this finishes, there are no items listed in my list control. I have
stepped through the code and everything looks fine except that the result
from LVM_INSERTITEM is -1;
This is weird, I can insert the columns, what would be wrong with the item?
Anyone see a problem with this?
Thanks for reading,
Steve