Fast control for bus monitor

K

kelvin.koogan

I am writing a bus monitor / protocol analyzer using VS 2005 C++/CLI.

Currently I am using a RichTextBox to display the messages. I am
adding each message with AppendText. This seems to be very slow; the
RichTextBox cannot keep up with the speed at which the messages come
in.

Is there a faster way to append new strings to the RichTextBox?

Alternatively is there a better control to use? The ListView seems to
update a little quicker but does not scroll as smoothly as the
messages are added.

TIA,
KK
 
A

AMercer

Currently I am using a RichTextBox to display the messages. I am
adding each message with AppendText. This seems to be very slow; the
RichTextBox cannot keep up with the speed at which the messages come
in.

Is there a faster way to append new strings to the RichTextBox?

Alternatively is there a better control to use? The ListView seems to
update a little quicker but does not scroll as smoothly as the
messages are added.

You need to batch your updates to optimize performance. With an rtb,
collect some lines (eg with StringBuilder), and AppendText a batch to the
rtb. With a listview, collect some lines and use lv.Items.AddRange. I
suggest a timer to append whatever is batched to the control and have your
analyzer batch its output and not worry about updating the control.
 

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