Hmmm, the fix posted by you, donkey, works to some degree, but if repeatedly clicking on the button, it appears that the problem is still there! I just don't get it? Maybe if there's someone else around here with Windows 2003 can post his result of executing this code?



/siddhartha
Posted on 2004-07-03 02:42:28 by siddhartha
invoke TrackPopupMenuEx, , TPM_RETURNCMD or TPM_NONOTIFY, , , , NULL

.if eax==IDM_ADD

erm, thats wrong too i think

Return Values

If the function succeeds, the return value is nonzero.

according to the win32 api.. the trackpopupmenuex last time i checked sends the selected menu item via wm_command, not as the return value
Posted on 2004-07-03 05:18:55 by evlncrn8
That's what I thought so too, but... msdn says


If you specify TPM_RETURNCMD in the uFlags parameter, the return value is the menu-item identifier of the item that the user selected. If the user cancels the menu without making a selection, or if an error occurs, then the return value is zero.
Posted on 2004-07-03 07:35:13 by roticv

Hmmm, the fix posted by you, donkey, works to some degree, but if repeatedly clicking on the button, it appears that the problem is still there! I just don't get it? Maybe if there's someone else around here with Windows 2003 can post his result of executing this code?


Sorry, it only dealt with why evlncrn8 could not display your dialog, I did not look at the other problem. Perhaps use GetLastError, or PrintError (from VKim) to find out what the error is. If there is no error and it is not being added then take a count of items, perhaps you only need to set the redraw flag. If you are using a stack based (local) structure to set the item be sure that it is properly set to 0 before filling it, you may have garbage in the structure for some calls and not for others. A common mistake people make is to only fill the parts of the structure that concern them, with a LOCAL you can be pretty sure that the other members will be set to random data and may fail the call.
Posted on 2004-07-03 10:33:19 by donkey
I think I made it work by adding this line:

mov lvi.iItem,0

Yes, donkey, you are right that I should assign values to all the members of the structure, if I don't want them to be randomly set!


/siddhartha
Posted on 2004-07-03 13:52:34 by siddhartha