Help with ListView_InsertItem

This is a discussion on Help with ListView_InsertItem within the Windows Programming forums, part of the Platform Specific Boards category; I included <commctrl.h> and linked with comctl32.lib The problem is it doesn't add the *pszItem to the listview. All I ...

  1. #1
    Registered User KonArtis's Avatar
    Join Date
    Mar 2003
    Posts
    34

    Help with ListView_InsertItem

    I included <commctrl.h> and linked with comctl32.lib

    The problem is it doesn't add the *pszItem to the listview. All I get is a blank item. I can't find where I'm goning wrong. If you need the rest of the code, it's attached.

    Code:
    void AddItem(char *pszItem)
    {
    	LVITEM	    pitem;
    	int		iLen=strlen(pszItem);
    
    	pitem.pszText=pszItem;
    	pitem.cchTextMax=iLen;
    	pitem.mask=LVCF_TEXT;
    	pitem.iSubItem=0 ;
    	pitem.iItem=uiItemCount;
    			
    	uiItemCount++;
    		
    	ListView_InsertItem(this->hwnd, &pitem);
    }
    Thanks
    Attached Files Attached Files

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,648
    LVIF_TEXT

    gg

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21