Thanks Ruben, good references Ruben J=F6nsson wrote: >> Funny you mention multithread and serial comm - that's exactly what I've = >> been working on today in C#. I've got tons of multithreaded apps in C++ = >> for serial communication, but I wanted to use C# for my latest project = >> (easier to code, launch, find helpful examples, etc...), and I found = >> that the serial port class was very easy to implement vs. what I had to = >> do to get multithreaded comm to work in C++. But, just like you = >> mentioned, I was tearing along making nice progress when I found that I = >> couldn't exit my application because the receive thread was deadlocked = >> trying to call part of my main thread as my main thread was trying to = >> exit. I found that by just using BeginInvoke to call the serial receive = >> handler rather than Invoke, it fixed it, but I'm still not sure if I'm = >> doing it right (never called EndInvoke) - seems to be working well = >> though after about 4hrs of continuous serial comm. = >> >> = > > You don't need to call BeginInvoke until you are going to manipulate GUI = > components. EndInvoke is not used with GUI components. (Actually that is = > Control.BeginInvoke and Control.EndInvoke). > > Here are some useful links when working with serial coms in C# > > _5B00_Kim-Hamilton_5D00_.aspx> > > 64ed-4f26-b9ad-e2ff1d3be0a5/> > > And here is how I usually handle receiving: > > 2885-43f9-958b-f2efb5a24411> > > /Ruben > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > Ruben J=F6nsson > AB Liros Electronic > Box 9124, 200 39 Malm=F6, Sweden > TEL INT +46 40142078 > FAX INT +46 40947388 > ruben@pp.sbbs.se > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > > = -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist