Creating texture from file using DirectxTex

Started by
1 comment, last by ajithk 8 years ago
Hai guys,

Anyone who worked with DirectxTex toolkit can help me. I am trying to load a texture from png file using createwictexturefromfile function. The arguments I have sent are fine. But the function fails with an error code E_NOINTERFACE. I think the hex code is 0x80004002. What does that mean?

The WICTextureLoader.cpp file inside that toolkit says in the comment section that it assumes the application has already called CoInitializeEx.I am not sure if I did. Is this the reason? The exact location in that file where the error returns goes like this

IWICImagingFactory* pWIC = _GetWIC();
if(!pWIC)
return E_NOINTERFACE

Btw, this toolkit is on github.
Advertisement

How are you not sure if you have called CoInitializeEx yet from your own code? Make a call and see if that fixes the error or not. If I remember correctly, subsequent calls to CoInitializeEx are not detrimental(someone correct me if I am wrong).

What I meant was, CoInititializeEx was not called by me in my hand written code. I was not sure if that function was called by any library, header etc which I have included and which may have called it as part of their initialization process :)

Anyway, I have included CoInitializeEx and CoUninitializeEx pair in my code and it worked.

This topic is closed to new replies.

Advertisement