Some back story:
I have searched both stackoverflow and Google to figure out the origin of this particular exception.
We have a Windows Forms (C#, .NET 2.0) application that will occasionally throw a System.AccessViolationException (stack trace below). The exception has occurred on both Windows XP (SP3) and Windows Vista (SP2). From user input, we have pinned down that the exception occurs when the selected index of a ComboBox is changed.
The ComboBox is a standard Windows Forms component, and it is contained in a custom control that inherits System.Windows.Forms.UserControl
.
My main query is:
Where does this exception come from?
SelectedIndexChanged
event that causes it?Related topics on stackoverflow:
Stack trace:
Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Type: System.AccessViolationException
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.Control.DefWndProc(Message& m)
at System.Windows.Forms.Control.WmCommand(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ComboBox.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)
I had these problems as well, way back when I used .net 2.0 WinForms. I seem to remember Microsoft released a Hotfix for this. I googled it and found these two. You could try them.
http://support.microsoft.com/kb/923028
http://support.microsoft.com/kb/971030
Also, did you install all Service Packs for .NET 2.0?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With