LVSIL_SMALL to SetImageList. LVSIL_NORMAL are the images for when the list
control is in Icon mode.
post the entire code for the dialog box.
AliR.
Its just not working
Like i said the same imagelist is being shared with the tree control and
this is displaying them fine. Here is some more example code
// setting up the image icons
mImages.Add(LoadIcon(IDI_ICON_GROUP));//6
mImages.Add(LoadIcon(IDI_ICON_REQUEST));//
mImages.Add(LoadIcon(IDI_ICON_RECEIVE));//8
// initialising the list control with image list
CDMSApp* pApp = static_cast<CDMSApp*>(AfxGetApp());
CImageList& images = pApp->GetImages();
mListCtrl.SetImageList(&images, LVSIL_NORMAL);
// associate item with image
ASSERT(mListCtrl.GetImageList(LVSIL_NORMAL) != NULL );
ASSERT(mListCtrl.GetImageList(LVSIL_NORMAL)->GetImageCount() >= 10 );
int nIndex = mListCtrl.InsertItem(0,"hello",7);
// buts its still not working?
the type of my list is report
"AliR (VC++ MVP)" wrote:
Joe there is one that takes 7 parameters.
int InsertItem(
UINT nMask,
int nItem,
LPCTSTR lpszItem,
UINT nState,
UINT nStateMask,
int nImage,
LPARAM lParam
);
http://msdn.microsoft.com/en-us/library/8b9s12fc.aspx
AliR.
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
news:98q8345vktihutnbvgp391aab0eha1131f@4ax.com...
On Wed, 21 May 2008 08:21:01 -0700, PRMARJORAM
<PRMARJORAM@discussions.microsoft.com>
wrote:
Ok i am successfully diplaying images in my tree controls but not my
list
controls.
I am using the following but not image is being displayed???
int nIndex = mListCtrl.InsertItem(LVIF_IMAGE | LVIF_TEXT,0,"hello",
0,0,7,0L);
****
What is this "0L" notation? Since integers are already 32-bit, there
is
no reason to use
the L suffix to make it a 32-bit value!
That would be _T("hello"). Think of 8-bit characters as dead
technology
except in rare
and exotic circumstances, which this is not.
I cannot find any version of CListCtrl::InsertItem that takes 7
parameters. There's a
version that takes
LVITEM*
and one that takes
int, LPCTSTR
and one that takes
int, LPCTSTR, int
but I cannot find a documented interface that takes 7 parameters.
joe
****
Where 7 is a valid index into my image list!
Please help?
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm