You need to use threads.
-Chris
Thanx for your reply Mr Tacke. But i have a little problem about threads.
In my main form ( code below my first mail) , i have a few function that
communicates from
comm1 port sequencely and saves data (comes from ports) to hash tables.
My second form shows these datas from hashtable by graphics by refreshing
every 2 seconds.
Main form must communicate with port until it is closed.
But when i use thread at form1 comm port datas mix and later gives
error.(CFSerial.Dll)
Because my communicate functions tries to work together on 1 port at the
same time when i use thread.
When they lose sequence , comm port locks..
Thanx in advance for any idea about this scenario...

Signature
Hakan Aktan
Software Developer
"<ctacke/>" <ctacke[@]opennetcf[dot]com>, haber iletisinde þunlarý
yazdý:OztWGHuaGHA.4784@TK2MSFTNGP02.phx.gbl...
> You need to use threads.
>
[quoted text clipped - 46 lines]
>> Next
>> End Sub
DJMatty - 29 Apr 2006 09:55 GMT
Hi
I think Chris is right, you need to run a single thread that
communicates with the com port and stores the data in a thread safe
manner.
The main application thread can read the data that is stored by the
worker thread from the serial port and display it.
You can't update form controls from a worker thread as this needs to be
done from the main thread. You can use the BeginInvoke method in your
worker thread to signal to your main thread that controls need
updating.
Have a look at this article.
http://www.yoda.arachsys.com/csharp/threads/winforms.shtml
This is quite interesting too:
http://www.codeproject.com/csharp/begininvoke.asp
It seems that .Net 2.0 checks for cross thread ui updates and throws
exceptions.
Matt
<ctacke/> - 29 Apr 2006 12:25 GMT
No, the main form should *not* be talking with the serial port. That's the
root of your problem. Move your comms to a separate thread, or use
event-based programming instead of polling (which is how the serial classes
are designed anyway).
-Chris
> Thanx for your reply Mr Tacke. But i have a little problem about threads.
> In my main form ( code below my first mail) , i have a few function that
[quoted text clipped - 59 lines]
>>> Next
>>> End Sub