RE: getHandle failed error code 495
- Posted by Matthew Lewis <matthewwalkerlewis at YAHOO.COM> Apr 22, 2002
- 410 views
> -----Original Message----- > From: jacktarred at yahoo.com [mailto:jacktarred at yahoo.com] > I have the following line in two programs: > > constant stox = addIcon( extractIcon("mystox.ico")) > > In one program I have no problems, in the other I get > the message: > > error code 495 > getHandle failed! > > I tried throwing in the path for good measure but to > no avail. Anyone have a suggestion? What exactly are you trying to do with the icon? addIcon() is for adding icons for listview/treeview/flattoolbars only. Your usage suggests you're adding an icon for a list/treeview. You need to have created the control before you can add icons for it. If you look at the code for addIcon, you'll see that it makes calls that add icons to ImageLists. One of the required parameters is the handle to the image list. Win32Lib manages this for you (assuming you've created a control that needs an ImageList). If you haven't created a list/treeview, then there is no handle, and getHandle will bomb when asked for it. :) extractIcon() is the right function for more general icon handling, but if you're not using a list/treeview/flattoolbar, then you shouldn't call addIcon(). Matt Lewis