SetItemImage() does not work on a CTreeCtrl object
Hello everybody. In a small dialog-based program of mine I am using a CTreeCtrl with a variable amount of child items. Now I want some items to have an icon besides the text which reflects the item state (the icons should not depend on whether the tree is expanded or not!). From what I read I should be using state based images in that case. "Normal" icons work well, but there seems to be something wrong with state based icons - they are not showing up at all.
Re: SetItemImage() does not work on a CTreeCtrl object
Thanks for your reply. Unfortunately only empty white fields appear next to the item name (I tried using the default icons IDI_ERROR and IDI_EXCLAMATION). But anyways, TVSIL_NORMAL icons are already working, I'm only having these issues with TVSIL_STATE icons. When using TVSIL_NORMAL icons all tree elements show the same image. Once I change the icon type to TVSIL_STATE no image is shown at all in the tree (even after calling SetItemImage()).
Maybe my understanding is wrong here but I thought creating a CImageList and assigning it to my CTreeCtrl is enough to be able to use SetItemImage() on a HTREEITEM to make one of the images in the list to show up?
Old C programmers never die. They're just cast into void.