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:
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: