4

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

Bart
  • 4,830
  • 16
  • 48
  • 68

7 Answers7

7

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 :)

Codejoy
  • 3,722
  • 13
  • 59
  • 99
  • 2
    Expanding on Codejoy's answer: you can "fix" the icon file with GIMP by opening and resaving the icon. Be sure to specify the file type as "Windows Icon" when saving the file and you will get a prompt for whether each image/layer is written as compressed PNG or not. For VS2005 and earlier do NOT use compressed PNG. – Daryl Hanson Apr 26 '12 at 16:42
  • Daryl, you saved our lives. Resaving in gimp absolutely did the trick. Our 256 layer was compressed, this fixed it. – Liz Dec 03 '15 at 15:56
3

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.

0xC0000022L
  • 20,597
  • 9
  • 86
  • 152
  • 1
    Thanks, you saved me a lot of head aches. I was stuck compiling a project built in VS 2003 and the icons desperately needed an overhaul. – thebunnyrules Feb 10 '17 at 06:02
1

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 ;)

Superbob
  • 712
  • 3
  • 5
  • 1
    Actualy it wasn't resolved with VS 2005 nor with VS SP1 nor with VS update for Vista as you still cannot have compressed PNG. You can use uncompressed 256x256 though. You just need to rember to uncheck the option when saving with GIMP (use Save As as only then you will get this option). – Nux Mar 27 '13 at 13:57
1

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

Richard
  • 419
  • 4
  • 3
  • This did the trick... A hint that might help some, I was using Visual C++ 6.0 (Yes, I have to *cries*). When I opened up the icon in resource editor, it was fine with several versions that don't even seem supported and you can't create in app (e.g. 128x128 32b). But one entry in the list was obviously buggy - 2573x1293, 16777216 colors. Deleting that one (Image->Delete Device Image with that frame in the editor) did the trick. Thanks Richard! – shiser Jun 28 '14 at 02:46
1

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.

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
KenS
  • 11
  • 1
0

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.

GlacJAY
  • 159
  • 4
  • 8
0

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

FrodoH
  • 101
  • 3