0

I am trying to load PNGs for HBITMAP. I found this post from stackoverflow. When I run the code I get REGDB_E_CLASSNOTREG on CoCreateInstance(CLSID_WICPngDecoder, NULL, CLSCTX_INPROC_SERVER, __uuidof(ipDecoder), reinterpret_cast<void**>(&ipDecoder). I am using Visual Studio 2012 RC, I've done CoInitlaize and I am still getting same error what could be possibly wrong?

MaX
  • 1,334
  • 13
  • 26

1 Answers1

1

WIC API suggest that you create decoder from factory, rather than directly using its CLSID. See IWICImagingFactory interface and sample code there.

You have options to create from file, stream or specifying container format GUID.

Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • I am getting ```REGDB_E_CLASSNOTREG Class not registered``` while creating instance of Factory. I copy pasted the MSDN example ```hr = CoCreateInstance( CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, IID_IWICImagingFactory, (LPVOID*)&pFactory ); ``` is throwing me ```REGDB_E_CLASSNOTREG Class not registered``` again! – MaX Aug 16 '12 at 13:23
  • 3
    I am tired of Microsoft breaking the API You need to replace ```CLSID_WICImagingFactory``` with ```CLSID_WICImagingFactory1``` I found it after lots of googling. http://social.msdn.microsoft.com/Forums/en-US/windowswic/thread/e542d34a-a04b-455e-bd5b-957f162bab94/ – MaX Aug 16 '12 at 13:28
  • Using CLSID_WICImagingFactory1 worked for me, I was getting the same Class not registered error when running it on windows embedded, even though CLSID_WICImagingFactory worked fine on win7. – Boccobrock Nov 14 '13 at 21:05