News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

ListView and SubItems problem

Started by Mr. Sade, January 08, 2007, 09:53:32 PM

Previous topic - Next topic

Mr. Sade

I don't know where the error is.. can somebody help me.

i can add list view items but i can't add list view sub items.
this is part of my code



local item:LVITEM

mov item.imask, LVIF_TEXT
mov item.iItem, 0
mov item.iSubItem, 0
mov item.pszText, OFFSET szText
invoke SendDlgItemMessage, hMainWnd, 103, LVM_INSERTITEM, 0, addr item
mov item.iSubItem, 1
invoke SendDlgItemMessage, hMainWnd, 103, LVM_SETITEM, 0, addr item
mov item.iSubItem, 2
invoke SendDlgItemMessage, hMainWnd, 103, LVM_SETITEM, 0, addr item


ListView is inside my resource script, Style=report

thank you

akane

I vote you do this inside WM_INITDIALOG, same problem here on xp 2002 sp2.
I solved this by posting a custom message WM_USER+3 from inside initdialog, and inside this custom message iI was able to add subitems.
Better way is to create non-modal dialog, then fill the list after CreateDialog.

// But at first, you must add one coulumn for each subitem: LVM_INSERTCOLUMN

Mr. Sade

u are right if i put the code directly inside WM_INITDIALOG it works
but if the code is inside a procedure and i call this procedure isnide WM_INITDIALOG it wont work.


Mr. Sade

i fixed it, stupid error!!
1 day trying to see what the problem was  :red