Sorry to send this
here....and I prob.should send to OffTopic, but just incase someone who is not
on the offtopic list knows the answer I am sending here.
This is a .Net
question that I asked lastnight 7pm but the email, infact no emails, has not
comethru form the nz dotnet mailing list. If someone knows the answer, I would
greatly appreciate the answer :-
Hi
all.
I fired up VS2005
for the first time today...well first time to DO something....and I noticed the
new SerialPort control.
This fitted in
nicely because I want to read some data from the comport for the wee app I want
to do.
Now I might be
approching this the wrong way, but I dropped a serialport control onto my
SmartDevice app....I am writting a PPC 2003 app. and set up the port settings
etc, and on the "DataReceived" event I am doing :-
TextBox1.Text =
SerialPort1.ReadLine()
And THIS is where it throws an
error. Can someone please help? The error is
:-
System.NotSupportedException was unhandled
Message="Control.Invoke must be used to interact with controls created on a separate thread."
StackTrace:
at Microsoft.AGL.Common.MISC.HandleAr()
at System.Windows.Forms.Control.get_Text()
at System.Windows.Forms.Control.set_Text()
at DeviceApplication1.Form1.SerialPort1_DataReceived()
at System.IO.Ports.SerialPort.CatchReceivedEvents()
at EventLoopRunner.CallReceiveEvents()
at WorkItem.doWork()
at System.Threading.Timer.ring()
Message="Control.Invoke must be used to interact with controls created on a separate thread."
StackTrace:
at Microsoft.AGL.Common.MISC.HandleAr()
at System.Windows.Forms.Control.get_Text()
at System.Windows.Forms.Control.set_Text()
at DeviceApplication1.Form1.SerialPort1_DataReceived()
at System.IO.Ports.SerialPort.CatchReceivedEvents()
at EventLoopRunner.CallReceiveEvents()
at WorkItem.doWork()
at System.Threading.Timer.ring()
Thanks,
Jeremy
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/200 - Release Date: 14/12/2005
_______________________________________________ Delphi mailing list [email protected] http://ns3.123.co.nz/mailman/listinfo/delphi
