   IDirect3DTexture9 ALWAYS returns ERR
  Hey all, thanks for reading, I'll try to be a coherent as I can.When I try to load in a texture using D3DXCreateTextureFromFile(), I always return D3DXERR_INVALIDDATA, I even checked to see if the image is in the right directory, and my teammate's sample code, using the same call, works fine. My code is being put into our engine, so it has a more "Component"-based design around it, but at the core is the same as my teammates, and we stared at this issue for 2 hours, and can't figure it out.PLLLLLLEEEAAASSSSEEEEE HELP.edit: Simply put, my call looks like: HRESULT hr = D3DXCreateTextureFromFile(pd3dDevice, fileName_.c_str(), &texture_);if(hr == D3DXERR_INVALIDDATA){exit(1);}The fileName contains "test.png"   
  Post the call itself, even if it is embedded deep within your own.Post any types.Post the values of all variables involved with the call at the time the call fails (step through with your debugger).I don't think anyone can tell you much with "this call fails, I don't know why"One guess I can make is:Anytime you are passing file paths, be sure you check things like absolut path vs relative, whether escape characters were used for slashes, filename extensions, and debug the current working directory path.the only things I can see going wrong with that call areA) the device is has not been created or is invalidB) the filepath is not what you think it is;  Right, my bad, here are the calls:Starts with:namespace Foo{   Foo::Object *theObject = new Foo::Object();   theObject->SetCoreTexture(std::string("test.png"));};SetCoreTexture's Implementation:void Object::SetCoreTexture(std::string &fileName){   // TextureNode_ is a Texture object in Object classTextureNode_->SetFileName(fileName);TextureNode_->SetTexture();}Those two texture functions are:void Texture::SetFileName(const std::string &fileName){fileName_ = fileName;}void Texture::SetTexture(void){HRESULT hr = D3DXCreateTextureFromFile(pd3dDevice, fileName_.c_str(), &texture_);if(hr == D3DXERR_INVALIDDATA){exit(1);}}The program exits there. Note: fileName_ is an std::string object in the Texture class.If something seems really odd, like missing code, just ask, I may have forgotten to post something somewhere. :P   ;  Fixed my problem, pathing is an issue, apparently you were right, the path I was using was REALLY NOT WHAT I THOUGHT IT WAS. Sorry for the inconvenience.   ;Quote:Original post by JimbobKRFixed my problem, pathing is an issue, apparently you were right, the path I was using was REALLY NOT WHAT I THOUGHT IT WAS. Sorry for the inconvenience.no problem, silly mistakes often frustrate us for days. I've claimed my compiler was broken more than once. Glad you got it fixed.   ;  I'd highly recommend using the Debug Runtimes, they would have told you that the file couldn't be found.   