I have Win32 C++ sample application that uses Windows Image Component in Visual Studio Pro 2012 Update 2. I built this app for X86 and tested in Windows 7 X64 SP1 and Windows 7 X86 SP1. It works fine with the first one and it fails on the later with "class not registered".
If I build the same code with VS2008 it works fine.
The WIC instance is created in the sample app as follows:
#include "wincodec.h"
...
case WM_CREATE:
{
IWICImagingFactory *m_pIWICFactory;
HRESULT hr = S_OK;
CoInitialize(NULL);
// create WIC factory (m_pIWICFactory)
hr = CoCreateInstance(
&CLSID_WICImagingFactory,
NULL,
CLSCTX_INPROC_SERVER,
&IID_IWICImagingFactory,
&m_pIWICFactory);
if (!SUCCEEDED(hr))
MessageBox(NULL,
L"CoCreateInstance(..IID_IWICImagingFactory..) failed!",
L"", MB_OK);
else
MessageBox(NULL,
L"CoCreateInstance(..IID_IWICImagingFactory..) succeeded!",
L"", MB_OK);
CoUninitialize();
}
break;
...
What could I be doing wrong?