CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Darrell Norton's Blog [MVP]

Fill in description here...

DirectX will throw an InvalidDataException if file is not found

Using Managed DirectX I was getting the following error:

An unhandled exception of type 'Microsoft.DirectX.Direct3D.InvalidDataException' occurred in System.Windows.Forms.dll
Unhandled Exception: Error in the application.

On a very simple TextureLoader.FromFile(device, filePath) operation.

Now an exception like InvalidDataException made me double-check that TextureLoader.FromFile can open tga files, which it can. It turns out, though, that DirectX will throw an InvalidDataException if it CANNOT find the file. I would have expected a FileNotFoundException, but I guess not. And this is from the latest DirectX SDK (October 2005). So double-check your filePath to make sure there's a file there!

Hey DirectX team, WTF were you thinking?


Published Nov 08 2005, 01:58 PM by darrell
Filed under:

Comments

Patrick Wellink said:

# November 9, 2005 2:38 AM

ZMan said:

email directx@microsoft.com - sounds like a decent idea for a change to me.
# November 9, 2005 10:50 PM
Check out Devlicio.us!

Our Sponsors