Error when using a RichTextBox in a C# application

T

Terminal882003

Hi,

I have a problem in my application(C#) if I using RichTextBox to
continuously display a series of text messages (using method
AppendText()). When application is running, it will stop at some point
(randomly), the error message is:

*********************************
System.NullReferenceException: Object reference not set to an instance
of an object.
at System.Windows.Forms.RichTextBox.EditStreamProc(IntPtr dwCookie,
IntPtr buf, Int32 cb, Int32& transferred)
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.WndProc(Message& m)
at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
at System.Windows.Forms.RichTextBox.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
***************************

Any solution will be more than welcome.

Thanks,
Mindy
 
J

jkohns

I'm getting the same problem in a VB.NET app. When the error occurs, it locks up the computer it's running on, so I can't ever tell exactly *what* was being displayed when it dies.

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top