🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Joe Walsh Thu, 20 Aug 1998 00:00
ListCtrl
#216
Author: Joe Walsh
Date: Thu, 20 Aug 1998 00:00
52 lines
1676 bytes
Hello there.

I'm having a bit of a problem with a list control I am trying to use
in a project. I have derived my own class from the CListCtrl class.

I use the following code to insert items. (I found it in an example)

BOOL MyListView::AddItem(int nItem,int nSubItem,LPCTSTR strItem,int
nImageIndex)
{
	LV_ITEM lvItem;
	lvItem.mask = LVIF_TEXT;
	lvItem.iItem = nItem;
	lvItem.iSubItem = nSubItem;
	lvItem.pszText = (LPTSTR) strItem;
	if(nImageIndex != -1){
		lvItem.mask |= LVIF_IMAGE;
		lvItem.iImage = nImageIndex; 
	}
	if(nSubItem == 0)
		return InsertItem(&lvItem);
	return SetItem(&lvItem);
}


I use the following function to get the icon index. (Also from an
example)

int MyListView::GetIconIndex(const CString& csFileName) 
{               
        SHFILEINFO    sfi;

        SHGetFileInfo(
           (LPCTSTR)csFileName, 
           0,
           &sfi, 
           sizeof(SHFILEINFO), 
           SHGFI_SYSICONINDEX | SHGFI_SMALLICON );

        return sfi.iIcon;
}


The code runs OK. My problem is that the icons for the files I insert
do not show up.
Also, subitems do not show up in report style.

Any ideas as to what I amy be doing wrong?

Any suggestions appreciated. 

b.t.w. I'm pretty green when it comes to VC++.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads