Jump to content
  • Advertisement
Sign in to follow this  
ajithk

Creating texture from file using DirectxTex

This topic is 823 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!