Hi everyone
I run into a problem with my callback function for the listview control.
I want the user to select an item either with cursor up/down or the mouse and then accept the selection with double click or spacebar. After that, the selection is processed in another sub.
Selection part works ok (thanks, MCM). So does the DBLCLK. But when I close the dialog in the %LVN_KEYDOWN-Part, i get the following message in the output window
HEAP: Free Heap block 1a48bf0 modified at 1a48cc0 after it was freed<0A>
I'm quite certain it must be something with the pointer, but this is fairly new stuff for me.
This occurs only when debugging, not when running the compiled version - but i'm sure the problem exists there as well.
Best regards,
Markus
I run into a problem with my callback function for the listview control.
I want the user to select an item either with cursor up/down or the mouse and then accept the selection with double click or spacebar. After that, the selection is processed in another sub.
Selection part works ok (thanks, MCM). So does the DBLCLK. But when I close the dialog in the %LVN_KEYDOWN-Part, i get the following message in the output window
HEAP: Free Heap block 1a48bf0 modified at 1a48cc0 after it was freed<0A>
I'm quite certain it must be something with the pointer, but this is fairly new stuff for me.
Code:
CALLBACK FUNCTION cbLv AS LONG LOCAL pNMLV AS NM_LISTVIEW PTR LOCAL kb AS LV_KEYDOWN PTR pNMLV = CB.LPARAM kb = CB.LPARAM SELECT CASE @pNMLV.hdr.code CASE %LVN_ITEMCHANGED IF ISTRUE @pNMLV.uCHANGED AND ISTRUE %LVIS_SELECTED THEN IF ISTRUE (@pNMLV.uNewState AND %LVIS_SELECTED) THEN IF @pNMLV.iItem > -1 THEN LISTVIEW GET TEXT CB.HNDL, %IDC_Listview, @pNMLV.iItem+1, 1 TO strSel FUNCTION = 1 END IF END IF END IF CASE %NM_DBLCLK MSGBOX strSel DIALOG END hdlg FUNCTION = 1 CASE %LVN_KEYDOWN SELECT CASE @kb.wVKEY CASE %vk_space MSGBOX strSel DIALOG END hdlg FUNCTION = 1 END SELECT END SELECT END FUNCTION
Best regards,
Markus
Comment