I have a problem with initializing an image list for a listview. I'm using MFC with doc/view. The problem is that when I try and retrieve the image list, with the SHGFI_SMALLICON flag enabled, I get a debugging error.
If i just use SHGFI_ICON, then it works fine, but then i don't get the small icons.
Here's my code:
Code:
SHFILEINFO ssfi;
m_ilSmall.Attach((HIMAGELIST)SHGetFileInfo(
"c:\\",
0,
&ssfi,
sizeof(SHFILEINFO),
SHGFI_SYSICONINDEX | SHGFI_ICON));
DestroyIcon(ssfi.hIcon);
If I used SHGFI_SMALLICON instead, then i get an error message.
I attached a zip file of two pics of the error message and the working prog, but with large icons.