Guest User

Untitled

a guest
Sep 14th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. AccessViolation occurs in RichTextBox.ScrollToCaret
  2. public void AppendLog(string message)
  3. {
  4. try
  5. {
  6. if (this.InvokeRequired)
  7. {
  8. this.Invoke(new Action<string>(this.AppendLog), message);
  9. }
  10. else
  11. {
  12. lock (_logSyncRoot)
  13. {
  14.  
  15. if (rtbLog.TextLength > 100000)
  16. rtbLog.ResetText();
  17.  
  18. rtbLog.AppendText(message);
  19. rtbLog.ScrollToCaret();
  20. }
  21. }
  22. }
  23. catch (Exception ex)
  24. {
  25. Logger.LogException(ex);
  26. }
  27. }
  28.  
  29. at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
  30. at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
  31. at System.Windows.Forms.Control.DefWndProc(Message& m)
  32. at System.Windows.Forms.Control.WndProc(Message& m)
  33. at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
  34. at System.Windows.Forms.RichTextBox.WndProc(Message& m)
  35. at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
  36. at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
  37. at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  38. at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, Int32 wParam, Object& editOle)
  39. at System.Windows.Forms.TextBoxBase.ScrollToCaret()
  40. at MyApp.UI.OfflineAnalyzer.AppendLog(String message) in D:MyAppCodeChartingOfflineAnalyzer.cs:line 339
Add Comment
Please, Sign In to add comment