There is a breaking change in VS2012 because it targets Windows 8 by default.
The solution is to specify CLSID_WICImagingFactory1
instaed of CLSID_WICImagingFactory
because the latter resolves to CLSID_WICImagingFactory2
, which does not exist in Windows 7.
So try this
hr = CoCreateInstance(&CLSID_WICImagingFactory1, NULL, CLSCTX_INPROC_SERVER,
&IID_IWICImagingFactory, &m_pIWICFactory);