WINCODEC_ERR_COMPONENTNOTFOUND

Mar 7, 2013 at 8:16 PM
Hi I have been working on extracting D3D11 device enumeration/ initializing code from DXUT along with SettingsDlg to work with only vs2012 and win8 sdk. It required me to port DXUTGUI in the process. Its almost done but can't find my around this error - WINCODEC_ERR_COMPONENTNOTFOUND when calling CreateWICTextureFromMemory.

I am trying to load that DXUTGUITextureSrcData texture that's harcoded in DXUTres.cpp

size_t size = g_DXUTGUITextureSrcDataSizeInBytes ;//* sizeof(DWORD) / sizeof(uint8_t);

CHFAILEDHR( DirectX::CreateWICTextureFromMemory(pd3dDevice,ptrImmediate,reinterpret_cast<const uint8_t *>(g_DXUTGUITextureSrcData),size,&pRes,NULL) );

Just wanted to avoid reinventing the wheel this time as i remember spending 1 month in DirectX9 Inititalizing.


Thanks

ChetanJags

chetanjags.wordpress.com
Coordinator
Mar 7, 2013 at 10:56 PM
Edited Mar 7, 2013 at 11:11 PM
Remember you have to

(A) Call CoInitialize / CoInitalizeEx somewhere in your app before using WIC (which I suspect you are doing based on the error code, but just in case)

(B) If you are trying to build and run an app on Windows 7 using the Windows 8.0 SDK, you need to explicitly set the _WIN32_WINNT to 0x601 (Windows 7) or 0x600 (Windows Vista). Otherwise you are requiring WIC2 be present which happens on Windows 8 and Windows 7 SP1 with KB 2380838 installed.

See these two posts:

Windows Imaging Component and Windows 8
Where's the DirectX SDK


That said, You should probably just be passing nullptr for the ID3D11DeviceContext.
Mar 8, 2013 at 6:01 AM
I have tried all the solutions you suggested went through those links and also installed platform update + vs remote debug tools to try WIC2 also.
I digged into DirectTK and now its creating IWICImagingFactory2 (wic2) instance.
But i am still getting the same error code from CreateWICTextureFromMemory.

Its failing while creating the decoder pWIC->CreateDecoderFromStream( stream.Get(), 0, WICDecodeMetadataCacheOnDemand, &decoder ) inside DirectX::CreateWICTextureFromMemoryEx() -> WICTextureLoader.cpp.

Do you think it might be becoz that harcoded texture in DXUTres.cpp (from dx sdk DXUT library) that I am trying to load using DirectTK might not be supported format or not being recognised by the decoder ?
If that's the case is there any way to convert it to some supported format or something ?
Coordinator
Mar 8, 2013 at 7:59 AM
It's probably a DDS texture, not a WIC codec.
Mar 8, 2013 at 5:04 PM
yea DDSLoader worked
THANKS