G
Guest
Dear All,
I am facing a problem while displaying data read from two COM ports. I read
two serial ports and update the data read in a text box in two different
forms.The reading part is perfect, the problem is both the forms are freezing
while displaying data.
here is what i did..
I am reading data from two COM ports simultaneously. There are two forms
named InputScan, Outputscan.
I have one base class which reads data from sepicified serial port. I
declared an event in the base class. And I raise this event when I am ready
to send Data to the form. This event is handled in the forms. In the event
handler I am displaying the data in a text box of that form.
In both the forms i created an instance of base class. I am handling the
event using a delegate and a local event handler. The forms are with in an
MDI form. When the applicaiton starts capturing data form both the ports only
one forms textbox is refershing at a time and the otherone is freezing. While
the first form is reading I am not able to do anything in the applicaiton for
eg: like moving the second form, to click a button in the second form etc.
But if I jsut write to textfiles with out displaying the data in the forms
then everything is perfect.
The problem could be because everything is running in the same thread. I
tried to create the base class instance in separate threads, but still there
is no change.
Can anyone help me how to solve this.
Thanks & Regards
Ram
I am facing a problem while displaying data read from two COM ports. I read
two serial ports and update the data read in a text box in two different
forms.The reading part is perfect, the problem is both the forms are freezing
while displaying data.
here is what i did..
I am reading data from two COM ports simultaneously. There are two forms
named InputScan, Outputscan.
I have one base class which reads data from sepicified serial port. I
declared an event in the base class. And I raise this event when I am ready
to send Data to the form. This event is handled in the forms. In the event
handler I am displaying the data in a text box of that form.
In both the forms i created an instance of base class. I am handling the
event using a delegate and a local event handler. The forms are with in an
MDI form. When the applicaiton starts capturing data form both the ports only
one forms textbox is refershing at a time and the otherone is freezing. While
the first form is reading I am not able to do anything in the applicaiton for
eg: like moving the second form, to click a button in the second form etc.
But if I jsut write to textfiles with out displaying the data in the forms
then everything is perfect.
The problem could be because everything is running in the same thread. I
tried to create the base class instance in separate threads, but still there
is no change.
Can anyone help me how to solve this.
Thanks & Regards
Ram