[?] LstView_SetItemText not working - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4) +---- Forum: Scripting (/forumdisplay.php?fid=39) +----- Thread: [?] LstView_SetItemText not working (/showthread.php?tid=77607) [?] LstView_SetItemText not working by Spunky on 09-19-2007 at 07:27 PM
The code (below) doesn't seem to be working right. I'm making a list of all my contacts and then trying to read nicknames from the registry and set them in the next column. Adding the contact works fine, but it won't set the nickname text. I've checked the value of nickname and it is correct, it's just the function failing for some reason (Only reason in documentation is that the window may have already closed, but it hasn't) code: RE: [?] LstView_SetItemText not working by markee on 09-20-2007 at 12:29 AM
You are trying to set the text of the next on in the list which doesn't exist yet. After you use LstView_AddItem, in the next line the LstView_GetCount is increased by 1 and therefore doen't have the same index. You can either minus one off of that in the SetItemText line, or you can just use the return value of the AddItem line and you should be fine. RE: [?] LstView_SetItemText not working by Spunky on 09-20-2007 at 12:35 AM
Minus 1 didn't work for some reason... Only about 5 or 6 contacts out of the list came up with the name... It's strange that they did when others didn't though. Using the returned index worked like a treat though Thanks. I couldn't understand because I've done this before somewhere. RE: [?] LstView_SetItemText not working by markee on 09-20-2007 at 11:47 AM
quote:OMG, I just watched that episode of family guy like 5 minutes ago. Anyway, I'm glad that I could help you. RE: [?] LstView_SetItemText not working by Matti on 09-20-2007 at 04:10 PM
LstView_AddItem returns the index of the added item. Use it!!! code: RE: [?] LstView_SetItemText not working by Spunky on 09-20-2007 at 04:42 PM
quote: Thats exactly what I did |