SimpleOpenGLControl Windows Vista
Hey all!
I was wondering if anyone has had any problems with the SimpleOpenGLControl on Vista? I have some demo software that runs fine on XP, and seems to run fine on some Vista machines, but not others. The application opens up and puts a big red X thru the SimpleOpenGLControl and an error message pops up: "Unhandled exception has occurred in your application ... Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
I used to get this error, ALL THE TIME, on XP until I did some optimizations, but I don't understand where the attempted to read/write etc comes from. I put try blocks around just about every section of code and narrowed it down to the Display routine that will, every so often, throw this error, but it's like 1 in 300 times opening the software and playing around with it for a while.
Any help appreciated! ;D
Mike

Looking into this more
Looking into this more closely, the details expansion points to the SwapBuffers() function call
If you want I can post the whole message, but it's really long and boring 
Thanks!
It would be great if you can
It would be great if you can post a test case with the least possible amount of code that reproduces the issue.
It would also be a good idea to log a bug - this way the issue won't be lost in the forums.
Edit: The actual error message will help, as well as anything else you can tell us about the system (32bit or 64bit? Are video drivers up to date? What make of video card?)
------
OpenTK
Error message is at the
Error message is at the bottom (JIT).
I am unable to narrow down the code that causes this issue. Inside the map_Paint, I have my main display logic (can't figure out why anything in there would cause the problem
) then map.SwapBuffers(); where map is the SimpleOpenGL control. I'm trying to get information on the users video card, but it's 32-bit Vista. I will see if I can strip out the code and have him run a shell. I'll post more when I know more ;D
Thanks!
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.AccessViolationException: Attempted to read or write protected
memory. This is often an indication that other memory is corrupt.
at Tao.Platform.Windows.Gdi.SwapBuffersFast(IntPtr deviceContext)
at Tao.Platform.Windows.SimpleOpenGlControl.SwapBuffers()
at _483OnlineFullWorld.Form1.map_Paint(Object sender,
PaintEventArgs e)
at System.Windows.Forms.Control.OnPaint(PaintEventArgs e)
at Tao.Platform.Windows.SimpleOpenGlControl.OnPaint(PaintEventArgs
e)
at
System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e,
Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.UserControl.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.312 (rtmLHS.050727-3100)
CodeBase:
file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
1483OnlineFullWorld
Assembly Version: 0.6.8.0
Win32 Version: 0.6.8.0
CodeBase:
file:///C:/Program%20Files/Guild%20of%20Blades/1483%20Full%20World%200
.6.8%20Demo/1483OnlineFullWorld.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.312 (rtmLHS.050727-3100)
CodeBase:
file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77
a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.312 (rtmLHS.050727-3100)
CodeBase:
file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/
System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.312 (rtmLHS.050727-3100)
CodeBase:
file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f1
1d50a3a/System.Drawing.dll
----------------------------------------
Tao.Platform.Windows
Assembly Version: 1.0.0.4
Win32 Version: 1.0.0.4
CodeBase:
file:///C:/Program%20Files/Guild%20of%20Blades/1483%20Full%20World%200
.6.8%20Demo/Tao.Platform.Windows.DLL
----------------------------------------
Tao.FreeGlut
Assembly Version: 2.4.0.1
Win32 Version: 2.4.0.1
CodeBase:
file:///C:/Program%20Files/Guild%20of%20Blades/1483%20Full%20World%200
.6.8%20Demo/Tao.FreeGlut.DLL
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.312 (rtmLHS.050727-3100)
CodeBase:
file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e
089/System.Xml.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.312 (rtmLHS.050727-3100)
CodeBase:
file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03
f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
Tao.OpenGl
Assembly Version: 2.1.0.4
Win32 Version: 2.1.0.4
CodeBase:
file:///C:/Program%20Files/Guild%20of%20Blades/1483%20Full%20World%200
.6.8%20Demo/Tao.OpenGl.DLL
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Suggestion off the top of my
Suggestion off the top of my head:
Single step through the code and make sure no opengl call occurs before the InitializeContexts() method is called.
------
OpenTK
It looks like the NXCOMPAT
It looks like the NXCOMPAT bit might be set in your executable. Try setting it to NO. Have a look at this:
http://blogs.msdn.com/ed_maurer/archive/2007/12/14/nxcompat-and-the-c-co...
Nope, nothing before
Nope, nothing before InitializeComponent()
Hmm... I looked at the article, I'll see if I can figure out how to do that; I'm not overly familiar with the innards of visual studio, I just code away and let it build
Thanks for the suggestions, still trying to get system info from the guy ~_~
Mike
Finally got the system
Finally got the system info:
ATI Radeon X1200
Toshiba Satelite A215
Windows Vista Home Premium 32 bit operating system
Processor = AMD Turion (tm)64 X2 Mobile Technology TL-58
1.90 GHz894 MB RAM