#252 Error in atlctrls.h line 3775 WTL81_9127

v1.0 (example)
closed-fixed
GDI (17)
5
2014-02-25
2012-03-09
Anonymous
No

On line 3775 in atlctrls is this code;
int AddItem(int nItem, int nSubItem, LPCTSTR strItem, int nImageIndex = -1)
{
ATLASSERT(::IsWindow(m_hWnd));
LVITEM lvItem = { 0 };
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) ? nItem : -1;
}

The problem is the default value for nImageIndex (-1) which is I_IMAGECALLBACK and therefore ignored.
I_IMAGENONE is (-2), the default value must therefore be something different for (-1) and (-2), eg (-3).

Discussion

    • assigned_to: nobody --> nenadstefanovic
     
    • status: open --> closed-fixed
    • Group: --> v1.0 (example)
     
  • Fixed, commit 3508, atlctrls.h