473,473 Members | 1,555 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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.GdipDrawLine I(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(PaintEv entArgs e) at
System.Windows.Forms.GroupBox.OnPaint(PaintEventAr gs e) at
System.Windows.Forms.Control.PaintWithErrorHandlin g(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.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message&
m) at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.GetSaveFi leName(OPENFILENAME_I
ofn) at
System.Windows.Forms.SaveFileDialog.RunFileDialog( OPENFILENAME_I ofn)
at System.Windows.Forms.FileDialog.RunDialogOld(IntPt r hWndOwner)
at System.Windows.Forms.FileDialog.RunDialog(IntPtr hWndOwner) at
System.Windows.Forms.CommonDialog.ShowDialog(IWin3 2Window owner) at
System.Windows.Forms.CommonDialog.ShowDialog() at
GateManPoly_Patch_Editor.Form1.GateMan_I_Patch_Edi tor_FormClosing(Object
sender, FormClosingEventArgs e) in
E:\VS2008\VB\Projects\Synth\GateManPoly_Patch_Edit or\GateManPoly_Patch_Editor\Form1.vb:line
886 at System.Windows.Forms.Form.OnFormClosing(FormClosin gEventArgs
e) at System.Windows.Forms.Form.WmClose(Message& m) at
System.Windows.Forms.Form.WndProc(Message& m) at
System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message&
m) at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.CallWindo wProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at
System.Windows.Forms.NativeWindow.DefWndProc(Messa ge& m) at
System.Windows.Forms.Form.DefWndProc(Message& m) at
System.Windows.Forms.Control.WndProc(Message& m) at
System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m) at
System.Windows.Forms.ContainerControl.WndProc(Mess age& m) at
System.Windows.Forms.Form.WmSysCommand(Message& m) at
System.Windows.Forms.Form.WndProc(Message& m) at
System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message&
m) at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.CallWindo wProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at
System.Windows.Forms.NativeWindow.DefWndProc(Messa ge& m) at
System.Windows.Forms.Form.DefWndProc(Message& m) at
System.Windows.Forms.Control.WndProc(Message& m) at
System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m) at
System.Windows.Forms.ContainerControl.WndProc(Mess age& m) at
System.Windows.Forms.Form.WmNcButtonDown(Message& m) at
System.Windows.Forms.Form.WndProc(Message& m) at
System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message&
m) at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
at
System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData) at
System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.Run(ApplicationCo ntext context) at
Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.OnRun()
at
Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.DoApplicationModel()
at
Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.Run(String[]
commandLine) at
GateManPoly_Patch_Editor.My.MyApplication.Main(Str ing[] 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.Run UsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text
executionContext, ContextCallback callback, Object state) at
System.Threading.ThreadHelper.ThreadStart()
InnerException:

Jun 27 '08 #1
6 4464
I'm curious, does this have anything to do with the .NET Framework ver
1.1?
On Sat, 10 May 2008 17:40:35 GMT, no*****@gte.net (Scott Gravenhorst)
wrote:
>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.GdipDrawLin eI(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(PaintE ventArgs e) at
System.Windows.Forms.GroupBox.OnPaint(PaintEventA rgs e) at
System.Windows.Forms.Control.PaintWithErrorHandli ng(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.W ndProc(Message&
m) at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.GetSaveF ileName(OPENFILENAME_I
ofn) at
System.Windows.Forms.SaveFileDialog.RunFileDialog (OPENFILENAME_I ofn)
at System.Windows.Forms.FileDialog.RunDialogOld(IntPt r hWndOwner)
at System.Windows.Forms.FileDialog.RunDialog(IntPtr hWndOwner) at
System.Windows.Forms.CommonDialog.ShowDialog(IWin 32Window owner) at
System.Windows.Forms.CommonDialog.ShowDialog() at
GateManPoly_Patch_Editor.Form1.GateMan_I_Patch_Ed itor_FormClosing(Object
sender, FormClosingEventArgs e) in
E:\VS2008\VB\Projects\Synth\GateManPoly_Patch_Edi tor\GateManPoly_Patch_Editor\Form1.vb:line
886 at System.Windows.Forms.Form.OnFormClosing(FormClosin gEventArgs
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.W ndProc(Message&
m) at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.CallWind owProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at
System.Windows.Forms.NativeWindow.DefWndProc(Mess age& m) at
System.Windows.Forms.Form.DefWndProc(Message& m) at
System.Windows.Forms.Control.WndProc(Message& m) at
System.Windows.Forms.ScrollableControl.WndProc(Me ssage& m) at
System.Windows.Forms.ContainerControl.WndProc(Mes sage& 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.W ndProc(Message&
m) at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.CallWind owProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at
System.Windows.Forms.NativeWindow.DefWndProc(Mess age& m) at
System.Windows.Forms.Form.DefWndProc(Message& m) at
System.Windows.Forms.Control.WndProc(Message& m) at
System.Windows.Forms.ScrollableControl.WndProc(Me ssage& m) at
System.Windows.Forms.ContainerControl.WndProc(Mes sage& m) at
System.Windows.Forms.Form.WmNcButtonDown(Messag e& m) at
System.Windows.Forms.Form.WndProc(Message& m) at
System.Windows.Forms.Control.ControlNativeWindow. OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message&
m) at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.Dispatch MessageW(MSG& msg)
at
System.Windows.Forms.Application.ComponentManager .System.Windows.Forms.UnsafeNativeMethods.IMsoComp onentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData) at
System.Windows.Forms.Application.ThreadContext.Ru nMessageLoopInner(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.ThreadContext.Ru nMessageLoop(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.Run(ApplicationC ontext context) at
Microsoft.VisualBasic.ApplicationServices.Windows FormsApplicationBase.OnRun()
at
Microsoft.VisualBasic.ApplicationServices.Windows FormsApplicationBase.DoApplicationModel()
at
Microsoft.VisualBasic.ApplicationServices.Windows FormsApplicationBase.Run(String[]
commandLine) at
GateManPoly_Patch_Editor.My.MyApplication.Main(St ring[] 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.Ru nUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text
executionContext, ContextCallback callback, Object state) at
System.Threading.ThreadHelper.ThreadStart()
InnerException:
Jun 27 '08 #2
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" wrote:
I'm curious, does this have anything to do with the .NET Framework ver
1.1?
On Sat, 10 May 2008 17:40:35 GMT, no*****@gte.net (Scott Gravenhorst)
wrote:
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.GdipDrawLine I(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(PaintEv entArgs e) at
System.Windows.Forms.GroupBox.OnPaint(PaintEventAr gs e) at
System.Windows.Forms.Control.PaintWithErrorHandlin g(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.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message&
m) at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.GetSaveFi leName(OPENFILENAME_I
ofn) at
System.Windows.Forms.SaveFileDialog.RunFileDialog( OPENFILENAME_I ofn)
at System.Windows.Forms.FileDialog.RunDialogOld(IntPt r hWndOwner)
at System.Windows.Forms.FileDialog.RunDialog(IntPtr hWndOwner) at
System.Windows.Forms.CommonDialog.ShowDialog(IWin3 2Window owner) at
System.Windows.Forms.CommonDialog.ShowDialog() at
GateManPoly_Patch_Editor.Form1.GateMan_I_Patch_Edi tor_FormClosing(Object
sender, FormClosingEventArgs e) in
E:\VS2008\VB\Projects\Synth\GateManPoly_Patch_Edit or\GateManPoly_Patch_Editor\Form1.vb:line
886 at System.Windows.Forms.Form.OnFormClosing(FormClosin gEventArgs
e) at System.Windows.Forms.Form.WmClose(Message& m) at
System.Windows.Forms.Form.WndProc(Message& m) at
System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message&
m) at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.CallWindo wProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at
System.Windows.Forms.NativeWindow.DefWndProc(Messa ge& m) at
System.Windows.Forms.Form.DefWndProc(Message& m) at
System.Windows.Forms.Control.WndProc(Message& m) at
System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m) at
System.Windows.Forms.ContainerControl.WndProc(Mess age& m) at
System.Windows.Forms.Form.WmSysCommand(Message& m) at
System.Windows.Forms.Form.WndProc(Message& m) at
System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message&
m) at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.CallWindo wProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at
System.Windows.Forms.NativeWindow.DefWndProc(Messa ge& m) at
System.Windows.Forms.Form.DefWndProc(Message& m) at
System.Windows.Forms.Control.WndProc(Message& m) at
System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m) at
System.Windows.Forms.ContainerControl.WndProc(Mess age& m) at
System.Windows.Forms.Form.WmNcButtonDown(Message& m) at
System.Windows.Forms.Form.WndProc(Message& m) at
System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message&
m) at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
at
System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData) at
System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.Run(ApplicationCo ntext context) at
Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.OnRun()
at
Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.DoApplicationModel()
at
Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.Run(String[]
commandLine) at
GateManPoly_Patch_Editor.My.MyApplication.Main(Str ing[] 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.Run UsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text
executionContext, ContextCallback callback, Object state) at
System.Threading.ThreadHelper.ThreadStart()
InnerException:

Jun 27 '08 #3
On Sat, 10 May 2008 16:16:01 -0700, Family Tree Mike
<Fa************@discussions.microsoft.comwrote:
>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" wrote:
>I'm curious, does this have anything to do with the .NET Framework ver
1.1?
On Sat, 10 May 2008 17:40:35 GMT, no*****@gte.net (Scott Gravenhorst)
wrote:
>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.GdipDrawLin eI(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(PaintE ventArgs e) at
System.Windows.Forms.GroupBox.OnPaint(PaintEventA rgs e) at
System.Windows.Forms.Control.PaintWithErrorHandli ng(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.W ndProc(Message&
m) at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.GetSaveF ileName(OPENFILENAME_I
ofn) at
System.Windows.Forms.SaveFileDialog.RunFileDialog (OPENFILENAME_I ofn)
at System.Windows.Forms.FileDialog.RunDialogOld(IntPt r hWndOwner)
at System.Windows.Forms.FileDialog.RunDialog(IntPtr hWndOwner) at
System.Windows.Forms.CommonDialog.ShowDialog(IWin 32Window owner) at
System.Windows.Forms.CommonDialog.ShowDialog() at
GateManPoly_Patch_Editor.Form1.GateMan_I_Patch_Ed itor_FormClosing(Object
sender, FormClosingEventArgs e) in
E:\VS2008\VB\Projects\Synth\GateManPoly_Patch_Edi tor\GateManPoly_Patch_Editor\Form1.vb:line
886 at System.Windows.Forms.Form.OnFormClosing(FormClosin gEventArgs
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.W ndProc(Message&
m) at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.CallWind owProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at
System.Windows.Forms.NativeWindow.DefWndProc(Mess age& m) at
System.Windows.Forms.Form.DefWndProc(Message& m) at
System.Windows.Forms.Control.WndProc(Message& m) at
System.Windows.Forms.ScrollableControl.WndProc(Me ssage& m) at
System.Windows.Forms.ContainerControl.WndProc(Mes sage& 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.W ndProc(Message&
m) at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.CallWind owProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at
System.Windows.Forms.NativeWindow.DefWndProc(Mess age& m) at
System.Windows.Forms.Form.DefWndProc(Message& m) at
System.Windows.Forms.Control.WndProc(Message& m) at
System.Windows.Forms.ScrollableControl.WndProc(Me ssage& m) at
System.Windows.Forms.ContainerControl.WndProc(Mes sage& m) at
System.Windows.Forms.Form.WmNcButtonDown(Messag e& m) at
System.Windows.Forms.Form.WndProc(Message& m) at
System.Windows.Forms.Control.ControlNativeWindow. OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message&
m) at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at
System.Windows.Forms.UnsafeNativeMethods.Dispatch MessageW(MSG& msg)
at
System.Windows.Forms.Application.ComponentManager .System.Windows.Forms.UnsafeNativeMethods.IMsoComp onentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData) at
System.Windows.Forms.Application.ThreadContext.Ru nMessageLoopInner(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.ThreadContext.Ru nMessageLoop(Int32
reason, ApplicationContext context) at
System.Windows.Forms.Application.Run(ApplicationC ontext context) at
Microsoft.VisualBasic.ApplicationServices.Windows FormsApplicationBase.OnRun()
at
Microsoft.VisualBasic.ApplicationServices.Windows FormsApplicationBase.DoApplicationModel()
at
Microsoft.VisualBasic.ApplicationServices.Windows FormsApplicationBase.Run(String[]
commandLine) at
GateManPoly_Patch_Editor.My.MyApplication.Main(St ring[] 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.Ru nUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text
executionContext, ContextCallback callback, Object state) at
System.Threading.ThreadHelper.ThreadStart()
InnerException:

Jun 27 '08 #4
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

Jun 27 '08 #5
On Sun, 11 May 2008 09:00:05 +0200, "Cor Ligthert[MVP]"
<no************@planet.nlwrote:
>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
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.


Jun 27 '08 #6
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

Jun 27 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sure | last post by:
Hello All, I want to update a form using the LWP & HTTP method. It was working fine when I am updating the values like this $ua = LWP::UserAgent->new; $url...
1
by: Li | last post by:
Hi, guys, I got a problem when trying to paging the recordset. the problem is even I set the pagesize but the first page will always show all the records and the number of records that shown on...
0
by: Anil0920 | last post by:
I have a very serious problem which really needs to be solved. We had a huge number of projects in 2002 that we recently converted to VS.NET 2003. The conversion was smooth and all is working well....
0
by: maxim mat | last post by:
Hi I need to build client for web service. But when I'm using Visual Studio .NET to add Web Reference, I get error: "Custom tool error: Unable to import WebService/Schema. Unable to import...
1
by: kimso.zhao | last post by:
Hi all, When I tried reading user command from console, I use "select" to wait for user input in order to improve efficiency. But when it comes to dealing with user pasting a command, there is a...
10
by: Ole | last post by:
Hi, Using VS2005 and a windows CE 5.0 device running CF2. Suddenly I can't debug my C# program from VS2005 - when setting a breakpoint I only see a ring instead of the normal red dot and when...
2
by: newsgroup.poster | last post by:
Hello, I'm encounterring the following problem when I try to add object datasource to my C# project: - the wizzard form open - I choose object, then click on next - the next screen display...
9
by: darthghandi | last post by:
I am trying to create a server application using asynchronous sockets. I run into a problem when I try to connect to my server using a non-.net program. I can establish the connection, and send...
5
by: cappieins | last post by:
Hi, i've got a problem using PHP FPDF library to create PDF files send inline to a browser window. The created PDF file opens correctly in the browser (IE 6), but if I want to save it to my...
3
by: sbettadpur | last post by:
hello I designed a web application using php and mysql for this i need to extract mail attachment from outlook express (specifically .doc files) for this is there any API's or any class or any...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.