VB2008 Express Edition Problem, "Attempted to read or write protected memory." when using SaveFile d

S

Scott Gravenhorst

Windows XP SP3

My application is set to open a SaveFile dialog when an exit is
requested. When I click the app's close button, the save dialog
opens, but when I click to change the folder, the exception occurs
pointing to FileSaveDialog1.ShowDialog(). The exception also
indicates some problem with system.drawing.dll.

The exception text is:
"Attempted to read or write protected memory. This is often an
indication that other memory is corrupt."

I've also included the exception details below.

In trying to resolve this, I first removed and reinstalled VB2008
Express Edition. After that failed to fix it, I reinstalled Windows
XP and installed VB2008 ExpEd yet again with the same results.

I have other apps that use the save dialog that work fine.

Also, when I copy the project structure to another WinXP SP3 machine
with VB2008 ExpEd installed, the application works perfectly. Both
machines have all of the updates for Windows and VS2005 as of today.

This exception also occurs when I use the application's file save
button as well as the load file button.

Can anyone please help me to determine what is wrong?

Thanks in advance,

-- ScottG



Exception Details:

System.AccessViolationException was unhandled
Message="Attempted to read or write protected memory. This is often
an indication that other memory is corrupt."
Source="System.Drawing"
StackTrace:
at
System.Drawing.SafeNativeMethods.Gdip.GdipDrawLineI(HandleRef
graphics, HandleRef pen, Int32 x1, Int32 y1, Int32 x2, Int32 y2) at
System.Drawing.Graphics.DrawLine(Pen pen, Int32 x1, Int32 y1, Int32
x2, Int32 y2) at
System.Windows.Forms.GroupBox.DrawGroupBox(PaintEventArgs e) at
System.Windows.Forms.GroupBox.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.GroupBox.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.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.GetSaveFileName(OPENFILENAME_I
ofn) at
System.Windows.Forms.SaveFileDialog.RunFileDialog(OPENFILENAME_I ofn)
at System.Windows.Forms.FileDialog.RunDialogOld(IntPtr hWndOwner)
at System.Windows.Forms.FileDialog.RunDialog(IntPtr hWndOwner) at
System.Windows.Forms.CommonDialog.ShowDialog(IWin32Window owner) at
System.Windows.Forms.CommonDialog.ShowDialog() at
GateManPoly_Patch_Editor.Form1.GateMan_I_Patch_Editor_FormClosing(Object
sender, FormClosingEventArgs e) in
E:\VS2008\VB\Projects\Synth\GateManPoly_Patch_Editor\GateManPoly_Patch_Editor\Form1.vb:line
886 at System.Windows.Forms.Form.OnFormClosing(FormClosingEventArgs
e) at System.Windows.Forms.Form.WmClose(Message& m) at
System.Windows.Forms.Form.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.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at
System.Windows.Forms.NativeWindow.DefWndProc(Message& m) at
System.Windows.Forms.Form.DefWndProc(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.Form.WmSysCommand(Message& m) at
System.Windows.Forms.Form.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.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at
System.Windows.Forms.NativeWindow.DefWndProc(Message& m) at
System.Windows.Forms.Form.DefWndProc(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.Form.WmNcButtonDown(Message& m) at
System.Windows.Forms.Form.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.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData) at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.Run(ApplicationContext context) at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[]
commandLine) at
GateManPoly_Patch_Editor.My.MyApplication.Main(String[] Args) in
17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at
System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args) at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state) at
System.Threading.ThreadHelper.ThreadStart()
InnerException:
 
S

Scott Gravenhorst

I'm curious, does this have anything to do with the .NET Framework ver
1.1?


Windows XP SP3

My application is set to open a SaveFile dialog when an exit is
requested. When I click the app's close button, the save dialog
opens, but when I click to change the folder, the exception occurs
pointing to FileSaveDialog1.ShowDialog(). The exception also
indicates some problem with system.drawing.dll.

The exception text is:
"Attempted to read or write protected memory. This is often an
indication that other memory is corrupt."

I've also included the exception details below.

In trying to resolve this, I first removed and reinstalled VB2008
Express Edition. After that failed to fix it, I reinstalled Windows
XP and installed VB2008 ExpEd yet again with the same results.

I have other apps that use the save dialog that work fine.

Also, when I copy the project structure to another WinXP SP3 machine
with VB2008 ExpEd installed, the application works perfectly. Both
machines have all of the updates for Windows and VS2005 as of today.

This exception also occurs when I use the application's file save
button as well as the load file button.

Can anyone please help me to determine what is wrong?

Thanks in advance,

-- ScottG



Exception Details:

System.AccessViolationException was unhandled
Message="Attempted to read or write protected memory. This is often
an indication that other memory is corrupt."
Source="System.Drawing"
StackTrace:
at
System.Drawing.SafeNativeMethods.Gdip.GdipDrawLineI(HandleRef
graphics, HandleRef pen, Int32 x1, Int32 y1, Int32 x2, Int32 y2) at
System.Drawing.Graphics.DrawLine(Pen pen, Int32 x1, Int32 y1, Int32
x2, Int32 y2) at
System.Windows.Forms.GroupBox.DrawGroupBox(PaintEventArgs e) at
System.Windows.Forms.GroupBox.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.GroupBox.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.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.GetSaveFileName(OPENFILENAME_I
ofn) at
System.Windows.Forms.SaveFileDialog.RunFileDialog(OPENFILENAME_I ofn)
at System.Windows.Forms.FileDialog.RunDialogOld(IntPtr hWndOwner)
at System.Windows.Forms.FileDialog.RunDialog(IntPtr hWndOwner) at
System.Windows.Forms.CommonDialog.ShowDialog(IWin32Window owner) at
System.Windows.Forms.CommonDialog.ShowDialog() at
GateManPoly_Patch_Editor.Form1.GateMan_I_Patch_Editor_FormClosing(Object
sender, FormClosingEventArgs e) in
E:\VS2008\VB\Projects\Synth\GateManPoly_Patch_Editor\GateManPoly_Patch_Editor\Form1.vb:line
886 at System.Windows.Forms.Form.OnFormClosing(FormClosingEventArgs
e) at System.Windows.Forms.Form.WmClose(Message& m) at
System.Windows.Forms.Form.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.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at
System.Windows.Forms.NativeWindow.DefWndProc(Message& m) at
System.Windows.Forms.Form.DefWndProc(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.Form.WmSysCommand(Message& m) at
System.Windows.Forms.Form.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.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at
System.Windows.Forms.NativeWindow.DefWndProc(Message& m) at
System.Windows.Forms.Form.DefWndProc(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.Form.WmNcButtonDown(Message& m) at
System.Windows.Forms.Form.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.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData) at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.Run(ApplicationContext context) at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[]
commandLine) at
GateManPoly_Patch_Editor.My.MyApplication.Main(String[] Args) in
17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at
System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args) at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state) at
System.Threading.ThreadHelper.ThreadStart()
InnerException:
 
F

Family Tree Mike

In your two messages you seem to have included VS 2005, VB 2008 Express, and
..Net 1.1. VS 2005 only targets 2.0 (AFAIK), and 2008 can target 2.0 and
higher. I don't think 2008 can target 1.1, but I might be wrong.

From the error message, is it some how possible in your code that there is a
thread still running that tries to interact with your UI while the save
dialog is displayed?

Scott Gravenhorst said:
I'm curious, does this have anything to do with the .NET Framework ver
1.1?


Windows XP SP3

My application is set to open a SaveFile dialog when an exit is
requested. When I click the app's close button, the save dialog
opens, but when I click to change the folder, the exception occurs
pointing to FileSaveDialog1.ShowDialog(). The exception also
indicates some problem with system.drawing.dll.

The exception text is:
"Attempted to read or write protected memory. This is often an
indication that other memory is corrupt."

I've also included the exception details below.

In trying to resolve this, I first removed and reinstalled VB2008
Express Edition. After that failed to fix it, I reinstalled Windows
XP and installed VB2008 ExpEd yet again with the same results.

I have other apps that use the save dialog that work fine.

Also, when I copy the project structure to another WinXP SP3 machine
with VB2008 ExpEd installed, the application works perfectly. Both
machines have all of the updates for Windows and VS2005 as of today.

This exception also occurs when I use the application's file save
button as well as the load file button.

Can anyone please help me to determine what is wrong?

Thanks in advance,

-- ScottG



Exception Details:

System.AccessViolationException was unhandled
Message="Attempted to read or write protected memory. This is often
an indication that other memory is corrupt."
Source="System.Drawing"
StackTrace:
at
System.Drawing.SafeNativeMethods.Gdip.GdipDrawLineI(HandleRef
graphics, HandleRef pen, Int32 x1, Int32 y1, Int32 x2, Int32 y2) at
System.Drawing.Graphics.DrawLine(Pen pen, Int32 x1, Int32 y1, Int32
x2, Int32 y2) at
System.Windows.Forms.GroupBox.DrawGroupBox(PaintEventArgs e) at
System.Windows.Forms.GroupBox.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.GroupBox.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.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.GetSaveFileName(OPENFILENAME_I
ofn) at
System.Windows.Forms.SaveFileDialog.RunFileDialog(OPENFILENAME_I ofn)
at System.Windows.Forms.FileDialog.RunDialogOld(IntPtr hWndOwner)
at System.Windows.Forms.FileDialog.RunDialog(IntPtr hWndOwner) at
System.Windows.Forms.CommonDialog.ShowDialog(IWin32Window owner) at
System.Windows.Forms.CommonDialog.ShowDialog() at
GateManPoly_Patch_Editor.Form1.GateMan_I_Patch_Editor_FormClosing(Object
sender, FormClosingEventArgs e) in
E:\VS2008\VB\Projects\Synth\GateManPoly_Patch_Editor\GateManPoly_Patch_Editor\Form1.vb:line
886 at System.Windows.Forms.Form.OnFormClosing(FormClosingEventArgs
e) at System.Windows.Forms.Form.WmClose(Message& m) at
System.Windows.Forms.Form.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.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at
System.Windows.Forms.NativeWindow.DefWndProc(Message& m) at
System.Windows.Forms.Form.DefWndProc(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.Form.WmSysCommand(Message& m) at
System.Windows.Forms.Form.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.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at
System.Windows.Forms.NativeWindow.DefWndProc(Message& m) at
System.Windows.Forms.Form.DefWndProc(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.Form.WmNcButtonDown(Message& m) at
System.Windows.Forms.Form.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.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData) at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.Run(ApplicationContext context) at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[]
commandLine) at
GateManPoly_Patch_Editor.My.MyApplication.Main(String[] Args) in
17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at
System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args) at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state) at
System.Threading.ThreadHelper.ThreadStart()
InnerException:
 
S

Scott Gravenhorst

In your two messages you seem to have included VS 2005, VB 2008 Express, and
.Net 1.1. VS 2005 only targets 2.0 (AFAIK), and 2008 can target 2.0 and
higher. I don't think 2008 can target 1.1, but I might be wrong.

From the error message, is it some how possible in your code that there is a
thread still running that tries to interact with your UI while the save
dialog is displayed?

No, It's a very simple application. And it runs fine on another XP
box I have.

However, riddle me this: I suspected .NET Framework as a source
because it was something that I had installed using an ATI video
driver CD.

When I tried to remove all of the .NET framework software, the
uninstaller encounters a problem and can't uninstall the hotfix for
1.1 nor .NET framework 1.1.

That made me suspiscious, so using another drive, I reinstalled XP but
I did NOT install the .NET framework ver 1.1. I then installed VB2008
express and the program is now working correctly on both systems.

The other system, the one that never failed, has a different video
card so I didn't need to install anything from that CD. When I was
installing the framework from that CD it was because I assumed the ATI
process needed it for something. Now I know better. Other than what
I just wrote, I don't have proof that it was .NET Framework 1.1
(possibly a corrupt copy), but in my mind, the evidence certainly
points to it.

In any case, it seems to be working now.

Thank you for your response.

-- ScottG

Scott Gravenhorst said:
I'm curious, does this have anything to do with the .NET Framework ver
1.1?


Windows XP SP3

My application is set to open a SaveFile dialog when an exit is
requested. When I click the app's close button, the save dialog
opens, but when I click to change the folder, the exception occurs
pointing to FileSaveDialog1.ShowDialog(). The exception also
indicates some problem with system.drawing.dll.

The exception text is:
"Attempted to read or write protected memory. This is often an
indication that other memory is corrupt."

I've also included the exception details below.

In trying to resolve this, I first removed and reinstalled VB2008
Express Edition. After that failed to fix it, I reinstalled Windows
XP and installed VB2008 ExpEd yet again with the same results.

I have other apps that use the save dialog that work fine.

Also, when I copy the project structure to another WinXP SP3 machine
with VB2008 ExpEd installed, the application works perfectly. Both
machines have all of the updates for Windows and VS2005 as of today.

This exception also occurs when I use the application's file save
button as well as the load file button.

Can anyone please help me to determine what is wrong?

Thanks in advance,

-- ScottG



Exception Details:

System.AccessViolationException was unhandled
Message="Attempted to read or write protected memory. This is often
an indication that other memory is corrupt."
Source="System.Drawing"
StackTrace:
at
System.Drawing.SafeNativeMethods.Gdip.GdipDrawLineI(HandleRef
graphics, HandleRef pen, Int32 x1, Int32 y1, Int32 x2, Int32 y2) at
System.Drawing.Graphics.DrawLine(Pen pen, Int32 x1, Int32 y1, Int32
x2, Int32 y2) at
System.Windows.Forms.GroupBox.DrawGroupBox(PaintEventArgs e) at
System.Windows.Forms.GroupBox.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.GroupBox.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.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.GetSaveFileName(OPENFILENAME_I
ofn) at
System.Windows.Forms.SaveFileDialog.RunFileDialog(OPENFILENAME_I ofn)
at System.Windows.Forms.FileDialog.RunDialogOld(IntPtr hWndOwner)
at System.Windows.Forms.FileDialog.RunDialog(IntPtr hWndOwner) at
System.Windows.Forms.CommonDialog.ShowDialog(IWin32Window owner) at
System.Windows.Forms.CommonDialog.ShowDialog() at
GateManPoly_Patch_Editor.Form1.GateMan_I_Patch_Editor_FormClosing(Object
sender, FormClosingEventArgs e) in
E:\VS2008\VB\Projects\Synth\GateManPoly_Patch_Editor\GateManPoly_Patch_Editor\Form1.vb:line
886 at System.Windows.Forms.Form.OnFormClosing(FormClosingEventArgs
e) at System.Windows.Forms.Form.WmClose(Message& m) at
System.Windows.Forms.Form.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.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at
System.Windows.Forms.NativeWindow.DefWndProc(Message& m) at
System.Windows.Forms.Form.DefWndProc(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.Form.WmSysCommand(Message& m) at
System.Windows.Forms.Form.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.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at
System.Windows.Forms.NativeWindow.DefWndProc(Message& m) at
System.Windows.Forms.Form.DefWndProc(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.Form.WmNcButtonDown(Message& m) at
System.Windows.Forms.Form.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.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData) at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.Run(ApplicationContext context) at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at
Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[]
commandLine) at
GateManPoly_Patch_Editor.My.MyApplication.Main(String[] Args) in
17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at
System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args) at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state) at
System.Threading.ThreadHelper.ThreadStart()
InnerException:
 
C

Cor Ligthert[MVP]

In your two messages you seem to have included VS 2005, VB 2008 Express,
and
.Net 1.1. VS 2005 only targets 2.0 (AFAIK), and 2008 can target 2.0 and
higher. I don't think 2008 can target 1.1, but I might be wrong.
You are right

Cor
 
S

Scott Gravenhorst

You are right

Cor

Cor,

That may be the case, and I believe you. However, the problem is back
again, on this particular machine. It now seems to be somewhat
intermittent.

The same project compiles and executes correctly on another machine -
so this is not a problem with another thread interfering.

Oddly enough, on the same machine that fails, I can run other VB2008
Express Edition apps that do not have this problem - and again, the
project that has the problem works correctly on at least one other XP
SP3 machine.

Any clues? i.e., what should I do to get more information about this
failure?

Are there any diagnostic programs available to help me determine the
cause of this?


---------- description of the program:

This program collects information from various controls, trackbars,
and some dropdowns. The information is then sent out a serial port to
another device. That's all it does. There's no need for any advanced
threading, it's a very simple program. I can post the code if that's
going to help.
 
S

Scott Gravenhorst

More information about this:

If I simply build the project and exit VB2008 and then double click
the executable created using Explorer, the exception does not occur.

-- ScottG
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top