Sign in to follow this  
ajithk

Creating texture from file using DirectxTex

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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).

Edited by ExErvus

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this