Question

what is this Error, and how to resolve it? I am using Visual studio 2005 for Smart device MFC developement, Is upgrading to 2008 can solve my problem.

Error 85 error RC2176 : old DIB in res\icon3.ico; pass it through SDKPAINT

Thanks

Was it helpful?

Solution

this might help you: http://www.axialis.com/tutorials/vistaicons.html

It looks like vista icons now use PNG headers. The error is slightly false though as its not an old DIB its just a header it doesn't recognize, PNG.

How was that icon created? Long ago Visual C++ 6.0 had its own little way of creating icon .ico files. Probably not using PNG so this might be the way to go is to find some program to emulate that and create an icon using the old DIB way. Or upgrading to 2008 :)

OTHER TIPS

Actually there is another way not mentioned here in the other answers.

If you would install and integrate a more recent (same or later release date than VS 2008) SDK with VS 2005, that also resolves it. You can also go to C:\Program Files\Microsoft Visual Studio 8\VC\bin (or your equivalent of the path) and replace the files rcdll.dll and rc.exe with the ones from a more recent VS, WDK or SDK.

Side-note: the version of rcdll.dll and rc.exe must match, that is you need to copy both at once from your source (be it VS, WDK or SDK). For me any version starting with 6.0 or 6.1 worked. That's any version starting from the compilers that accompanied the Vista SDKs and VS versions or later.

There are actually 2 situations I've encountered that lead to this error RC2176.
As you probably know, a Windows .ICO file can contain multiple images for different sizes and color depth. VS2005 throws this error in at least two situations (unrelated to DIB)

  1. .PNG images in the icon (as described in Codejoy's answer)
  2. 256x256 or larger images in the icon

By using GIMP to shrink the largest image size to 128x128, and avoiding .PNG, the problem is resolved with VS2005. Or, upgrade to a newer VS ;)

I had this problem in VS2012 for which I googled but didn't find anything else but this link to a MSDN site which talked about opening it up with sdk-paint , so in my project I doubleclicked the icon that was responsible for the error and deleted the PNG format and voila program started.

Greetz

Richard

The compressed/packed 256x256 was the problem for me. Once I unchecked the option to save as compressed (for Vista) in my icon editor app, the problem went away.

There is another situation I encountered which triggered the error, that is a corrupted PNG file. I've used the sed command to globally replace some strings in the project folder, and it just replaced the (looks liked) windows line ending to UNIX one, which caused my image files corrupted.

So, maybe there are some bugs in the PNG parser of MFC library, which cannot handle malformed input files.

Best resolution I have come across is from Axialis where they offer guidance of saving the ICO file in uncompressed PNG format. https://www.axialis.com/docs/iw/How_to_use_a_Windows_Vista_Compressed_Icon_in_a_Software_Project.htm

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top