Thread: Help with ListView_InsertItem

  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

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

    gg

Popular pages Recent additions subscribe to a feed