10151 : I cant get any image (using ImageIndex) to appear in all phGantX tree nodes in Windows XP


I am not sure if this is happening to anyone else I cant get any image (using ImageIndex)  to appear in all phGantX tree nodes in Windows XP and Windows 2003 Server. I ran sample VB ( Samples\ActiveX\VB6\GanttWithGrid ) to confirm this.

Please advise. Thanks.


This is probably not an issue of the phGantTimePackage but an imagelist problem.
The imagelist is part of the comctrl.ocx and this component has caused a lot of confusion on XP. The original comctrl32.dll that came with XP was not compatible with older versions and broke many applications. I think you should examine what version of the comctrl32.dll you are using and try to upgrade your XP machine to the latest version.

Microsoft issued a fix for the comctrl32.dll.

They describe the problem here (I hate pasting microsoft links into the KB, have you noticed how often they change their links just to break other peoples references, anyway here goes):


This is what they wrote so that you can use google to find the article if (when) the link above is broken…


You can use SendMessage to get the image handle from various controls in Microsoft Windows Common Controls 6.0 (Mscomctl.ocx). By using SendMessage, you can pass TB_GETIMAGELIST, LVM_GETIMAGELIST, TVM_GETIMAGELIST, or TCM_GETIMAGELIST to get the imagelist handle for the Toolbar, ListView, TreeView, and TabStrip controls.

However, when you do this on a computer running Windows XP, the wrong handle is returned. If you call any other APIs, and then pass this handle, those API calls will not function correctly.


This problem occurs because Windows XP and Mscomctl.ocx load two different versions of Comctl32.dll that are not compatible.


A supported fix is now available from Microsoft, but it is only intended to correct the problem described in this article. Only apply it to systems that are experiencing this specific problem. This fix may receive additional testing to further ensure product quality. Therefore, if you are not severely affected by this problem, Microsoft recommends that you wait for the next Visual Studio 6.0 service pack that contains this fix.

< ?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Leave a Reply