Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SetImageList() don’t work (se my code)

Status
Not open for further replies.

d00ape

Programmer
Apr 2, 2003
171
SE
Look at this:
______________________________________________________

CImageList *m_pimagelist = new CImageList();
m_pimagelist->Create( 16, 16, ILC_COLOR8, 0, 4);

HICON icon = AfxGetApp()->LoadIcon( IDI_ICON1 );
if( icon == NULL )
; // This Doesn’t happen

int ret = m_pimagelist->Add( icon );
ret = m_pimagelist->Add( icon );
ret = m_pimagelist->Add( icon );

int count = m_pimagelist->GetImageCount();

// count is now correctly == 3
// So far so good

SetImageList( m_pimagelist, TVSIL_NORML );

CImageList *p = GetImageList(TVSIL_NORML);

if( p == NULL )
; // THIS HAPPENS!!
______________________________________________________

How come that “SetImageList( m_pimagelist, TVSIL_NORML )” Doesn’t work?
All suggestions are welcomed!!
 
I guess TVSIL_NORML should be TVSIL_NORMAL (just a typo in the post?

Does the image list contain large icons at all(TVSIL_NORMAL = Image list with large icons)?

/Per

"It was a work of art, flawless, sublime. A triumph equaled only by its monumental failure."
 
Sorry TVSIL_NORMAL

But it doesn't work anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top