Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ListView_InsertItem

Status
Not open for further replies.

harley96

IS-IT--Management
Feb 11, 2005
1
DE
Hi,
i need help, cause ListView_InsertItem returns 0 in case the lvi.pszText was inserted before. For example:
i inserted "hugo99" and at the second try to insert the same string i got 0 in ret.
What do i wrong? Following my code...

Thx Klaus

memset(&lvi,'\0',sizeof(lvi));

lvi.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
lvi.pszText = lpSEARCHTBLtmp->cName;
lvi.lParam = lpSEARCHTBLtmp->nIndex;
lvi.iImage = lpSEARCHTBLtmp->nKZ - 1;
ret = ListView_InsertItem(hWndSearchItems, &lvi);
 
every time you insert an item, it's inserting it in the '0' row, so that's what it's returning. The way you're doing it, if you insert 1,2,3,4,5 your list will look like this:

5
4
3
2
1



BlackDice

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top