I am trying to add items to my listview, but they always show up empty. Here's what am using:
static void InsertItem(HWND hwndParent, PCHAR pszAddress, PCHAR pszByteCode, PCHAR pszDisassembly, PCHAR pszComment) {
static HWND hWndListView;
static LV_ITEM lvI;
ZeroMemory(&lvI, sizeof(lvI));
hWndListView = GetDlgItem(hwndParent, IDC_DISASMLIST);
lvI.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;
lvI.iItem = 1;
lvI.iSubItem = 0;
lvI.pszText = (LPWSTR)pszAddress;
ListView_InsertItem(hWndListView, &lvI);
g_iItem = ListView_GetItemCount(hWndListView);
lvI.iSubItem = g_iItem;
lvI.pszText = (LPWSTR)pszByteCode;
ListView_SetItem(hWndListView, &lvI);
g_iItem++;
lvI.iSubItem = g_iItem;
lvI.pszText = (LPWSTR)pszDisassembly;
ListView_SetItem(hWndListView, &lvI);
g_iItem++;
lvI.iSubItem = g_iItem;
lvI.pszText = (LPWSTR)pszComment;
ListView_SetItem(hWndListView, &lvI);
}
Am I doing something wrong? any ideas would be really helpful? Thanks in advance.
Regards,
halsten