A decision was recently made here on the project to switch from using a DLL for a large (>500) set of "map icons" to using a folder full of .ico files (making it simpler for users and us to add new icons). The icon DLL was built using MS Visual Studio 6.0 on a Windows 2K machine. Not being a glutton for punishment, I tried simply pulling the intermediate .ico files from the DLL project and loading them using WbIcon fromFile:size:.
The problem I'm encountering is within CgWinICOFileFormat. This class retrieves a header from the .ico file and reads some property data (dimensions, color depth, offset). It appears that MS standard 256-color icons do not follow the same standard as CgWinICOFileFormat. Every MS 256-color icon I've mucked around with (including MS-built ones like MSN.ico in the MS Office folder) have a 0 at the location where CgWinICOFileFormat is expecting to find the number of colors. 16-color and 2-color icons I've created do have the color depth property assigned properly.
This problem rears its head in CgWinICOFileFormat>>loadInfoHeader:iconHeader:. I'm currently working around it by testing if numColors is 0 and setting it to 256; this does not seem like the best solution. Manually tweaking the .ico file with a hex editor fixes that problem in Smalltalk, but makes it unrecognizable to the Visual Studio icon editor.
Are there any thoughts as to a (better) workaround or long-term fix to this issue?
Brian O'Connell
Simulation Domain
Joint Analysis System (JAS)