Users sometimes get the above error when using our application (VB.Net, Winforms, using v2 as part of the framework). I can not reproduce it. The column is as follows:
: System.AccessViolationException: Attempted to read or write protected memory. This often indicates that another memory is corrupted. in System.Windows.Forms.UnsafeNativeMethods.CallWindowProc (IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) in System.Windows.Forms.NativeWindow.DefWndProc (Message & m) in System.WindowsF. DefWndProc (Message & m) in System.Windows.Forms.Control.WndProc (Message & m) in System.Windows.Forms.ComboBox.WndProc (Message & m) in ControlEx.AutoCompleteCombo.WndProc (Message & m) in System. Windows.Forms.Control.ControlNativeWindow.OnMessage (Message & m) in System.Windows.Forms.Control.ControlNativeWindow.WndProc (Message & m) in System.Windows.Forms.NativeWindow.Callback (IntPtr hWnd, Int32 msg, IntPtr wparam , IntPtr lparam)
The ControlEx.AutoCompleteCombo.WndProc code is as follows:
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Try
If Not m_fReadOnly Then
MyBase.WndProc(m)
Else
Select Case m.Msg
Case WM_LBUTTONDOWN, WM_LBUTTONDBLCLK
' do nothing
Case Else
MyBase.WndProc(m)
End Select
End If
Catch ex As OutOfMemoryException
Throw New OutOfMemoryException("Exception during WndProc for combo " & Me.Name, ex)
End Try
End Sub
Error handling has been added, so we can determine which combination causes the problem when we get an OutOfMemoryException.
Any clues as to what causes this would be greatly appreciated !:-)
source
share