Re: Listview - Adding an item
- Posted by Derek Parnell <ddparnell at bigpond.com> Jun 29, 2003
- 513 views
----- Original Message ----- From: "Guillermo Bonvehi" <knixeur at speedy.com.ar> To: "EUforum" <EUforum at topica.com> Subject: Listview - Adding an item > > > Hi all, > I'm currently trying to add an item to a listview i made using a > resource dialog, i think i did it the way it should be done, but it's > not working :( > This is what i got: > > function makeLV_ITEM(sequence items) > atom hwnd > hwnd = allocate(36) > for I = 0 to length(items)-1 do > poke4(hwnd+(I*4),items[I]) > end for > return hwnd > end function > > --- This is inside the WM_INITDIALOG event > > LPTSTR = allocate_string("Test") > > LV_ITEM = makeLV_ITEM({ > or_all({LVIF_TEXT,LVIF_PARAM}), > 0, > 0, > 0, > 0, > LPTSTR, > 7, > 0, > 0 > }) > > void = c_func(xSendMessage, {GetDlgItem(hWnd, PANEL1), > LVM_INSERTITEM, 0, LV_ITEM}) > free(LV_ITEM) > free(LPTSTR) > > --- End > > Can any win32 guru tell me where the problem is? I do not think I can help you. I have never worked with true dialogs. Does GetDlgItem() return the hWnd of the ListView? I also notice that the text length is givenas 7 but the text is only 4 bytes. -- Derek