After my game has been running for a certain amount of time, the same Warning shows up and my game breaks. I am not sure why this is and I cannot find a solution for it.
The message that keeps popping up is as follows:
Microsoft Visual Studio Express 2013 for Windows Desktop
An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in System.Drawing.dll
Additional information: The operation completed successfully
I have an Object class that deals with all of the Objects displayed on screen (position, collisions etc) and the warning seems to be coming from this class. When the warning is displayed, one line in-particular is highlighted every time, that is:
public Obj(Vector2 pos)
{
position = pos;
}
Any help resolving my problem will be appreciated
You have an exception in an unmanaged component of your game. Go to Debug -> Exceptions and tick the "user-unhandled" box in the
Win32 Exceptions
row.This way, your debugger will break whenever a Win32 exception is thrown, and if you have the required symbols loaded, you'll be able to debug the code as you normally would.
Furthermore, you can obtain the last Win32 error code using the
Marshal.GetLastWin32Error
method. Armed with that information, you should be able to figure out what your code is throwing on precisely, and how to resolve it.