Jump to content
  • Advertisement
Sign in to follow this  
Geekwad

[.net] System.Drawing error

This topic is 4771 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

I'm attempting to create a basic DirectX app from the Tutorial at http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_m/directx/direct3d/tutorials/tutorial1.asp I get, what I think might be, a common error on the line using (CreateDevice frm = new CreateDevice()) A breakpoint suggests that it doesn't even enter the CreateDevice constructor. The error is: ------------- An unhandled exception of type 'System.IO.FileNotFoundException' occurred in DirectXTest.exe Additional information: File or assembly name System.Drawing, or one of its dependencies, was not found. ------------- I DO have a reference for System.Drawing in the solution. I have using System; and using System.Drawing; in my code and I checked that the file C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Drawing.dll (which is referenced) exists. I got the same error when I tried to run a tutorial from a different page, as well. Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
And by adding a reference you literally mean that you added a "reference" and didn't just use the using statement? Are you using Visual Studio and getting the same problem when you create a Windows Application?

Share this post


Link to post
Share on other sites
This is Visual Studio .NET
(NOT 2003)
This is a C# Windows Application

And initially I just added the using System.Drawing line .. And the reference was added automatically. I also tried re-adding it manually. Same deal.

Share this post


Link to post
Share on other sites
Quote:
Original post by Geekwad
This is Visual Studio .NET
(NOT 2003)
This is a C# Windows Application

And initially I just added the using System.Drawing line .. And the reference was added automatically. I also tried re-adding it manually. Same deal.

Ah, what SDK are you using? I think .Net Framework 1.0 is no longer supported by the current version of Managed DX. Someone feel free to correct me on that.

Share this post


Link to post
Share on other sites
Yeah, I'm using the latest, June 2005 SDK.
I think you're right; it may no longer be supported.

That .. would .. suck.

Share this post


Link to post
Share on other sites
Quote:
Original post by Geekwad
Yeah, I'm using the latest, June 2005 SDK.
I think you're right; it may no longer be supported.

That .. would .. suck.

You can always use the compiler that comes with .Net Framework 1.1 instead, or download a Visual Studio Express Beta since VS 2005 support was added with the latest release.

Share this post


Link to post
Share on other sites
Ok, I installed Framework 1.1 and the error no longer happens, but now I have a new issue.

An exception is thrown on the device = new Device line at the end of the following block. It's exactly from the tutorial, though. ...

public bool InitializeGraphics()
{
try
{
// Create a PresentParameters object
PresentParameters presentParams = new PresentParameters();

// Don't run full screen
presentParams.Windowed = true;

// Discard the frames
presentParams.SwapEffect = SwapEffect.Discard;

// Instantiate a device
device = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presentParams);
return true;
}
catch { return false; }
}

Share this post


Link to post
Share on other sites
Posting the exception description would help us a lot with knowing what the problem is. Otherwise we have to guess, and that is hard [grin]

Share this post


Link to post
Share on other sites
You're gonna love this.

The exception on line:
device = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presentParams);

is:
-------------
An unhandled exception of type 'Microsoft.DirectX.Direct3D.InvalidCallException' occurred in microsoft.directx.direct3d.dll

Additional information: Error in the application.
-------------

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!