MDX Sample code doesn't work in my Visual Studio .NET 2005

Recently I got a new VS 2005, and downloaded DirectX SDK February 2006.

I opened the DirectX Sample Browser, all the samples can be executed just fine. However after I installed these samples, let's say, EmptyProject(managed), I can build the sample code successfully, it just didn't work. And all the sample code using .NET Framework 1.1 failed to start up with this error messagebox:

// .NET Framework 1.1 version
Failed creating the Direct3D Device.

System.NullReference Exception: Object reference not set to an instance of an object.
at Microsoft.Samples.DirectX.UtilityToolKit.ResourceCache.OnResetDevice(Device device) in C:\CustomFolder\EmptyProject\common\dxmutmisc.cs:line 778
at Microsoft.Samples.DirectX.UtilityToolKit.Framework.Initialize3DEnvironment() in C:\CustomFolder\EmptyProject\Common\dxmut.cs:line 2818


System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Samples.DirectX.UtilityToolkit.ResourceCache.OnLostDevice() in C:\CustomFolder\EmptyProject\Common\dxmutmisc.cs:line 788
at Microsoft.Samples.DirectX.UtilityToolkit.Framework.Cleanup3DEnvironment(Boolean releaseSetings) in C:\CustomFolder\EmptyProject\Common\dxmut.cs:line 2721
.
.
.
(similar pattern, error function followed by error code line)


///////// And, if I install a sample code written in .NET Framework 2.0,
///////// i still couldn't run the program, with an error messagebox like this:
Failed creating the Direct3D device.

Error in the application
-2005529767 (D3DXERR_INVALIDDATA)
at Microsoft.DirectX.Direct3D.Effect.FromFile(Device device, String effectFile, Macro[] preprocessorDefines, Include includeFile, String skipConstants, ShaderFlags flags, EffectPool pool)
at Microsoft.Samples.DirectX.UtilityToolkit.ResourceCache.CreateEffectFromFile(Device device, String Filename, Macro[] defines, Include includeFile, ShaderFlags flags, EffectPool effectpool) in C:\CustomFolder\EmptyProject_2005\Common\wdxmutmisc.cs:line 693
at EmptyProjectSample.EmptyProject.OnCreateDevice(Object sender, DeviceEventArgs e) in C:\CustomFolder\EmptyProject_2005\EmptyProject.cs:line 146
at Microsoft.Samples.DirectX.UtilityToolkit.Framework.Initialize3DEnvironment() in C:\CustomFolder\EmptyProject_2005\Common\wdxmut.cs:line 2794


So far, I can't utilize any managed sample code provided with the SDK, so frustrating. (the unmanaged C++ sample code are all ok) I feel really strange because the computer I use was bought several weeks ago, with Intel Pentium M Processor 740(1.73GHz), 1.0GB Memory and ATI Mobility Radeon X700. And the VS.net 2005 & DirectX SDK Feb 2006 have been intact after I installed them, no settings have been changed. However the sample code just doesn't work!

Has anybody ever met this problem before I'm a beginner to managed DirectX, I just want to use the DirectX Sample Framework. Plz help...


Answer this question

MDX Sample code doesn't work in my Visual Studio .NET 2005

  • Ljiljana

    I can't give you a good answer. All I can say is that it works for me (I tried the EnhancedMesh sample). I have little experience with MDX, but all I can say is that it doesn't seem to be a problem inherent in the SDK or VS.

  • jp01uk

    Did you already try my suggestion to your topic on this on GameDev To recap, it looks like the effect file (.fx, the shader) for the sample could not be found. You could try copying the needed effect to your project directory manually if it's indeed not already there.

    This really shouldn't happen, so you might want to verify the DirectX SDK is correctly installed and/or reinstall it if need be. Good luck with it at any rate :)



  • wacko

    Have you try to run one of the already build managed samples Do they fail too



  • James Risinger

    All the samples already built along with the SDK all work fine. But all the samples built in my VS 2005 always fail:(
  • MDX Sample code doesn't work in my Visual Studio .NET 2005