Listview - Adding an item

new topic     » topic index » view thread      » older message » newer message

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?

TIA,
    Guillermo Bonvehi

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu