Hello all.
I'm developing a mixed Windows CE 5 and PC system APP that uses a serial
port component to comunicate with other devices.
App works fine under Windows CE device, but it locks in PC. If it is under
debugger, locks Visual Studio too, and if it running alone, it gives the
exception
AppName: buttonpanelpc.exe AppVer: 1.0.0.0 AppStamp:450fbf8a
ModName: mscorwks.dll ModVer: 2.0.50727.42 ModStamp:4333c83c
fDebug: 0 Offset: 000000000016d3cd
While in exception, app locks Explorer too. When app closes, all continue
working.
Program uses a Windows Forms Timer that polls external devices via serial
port. Then, when I need to directly comunicate with other devices, I stop
timer and start to send/receive data via UI buttons click. All stuff is like
this:
StopTimer();
SendCommand();
WaitResponse();
StartTimer();
UpgradeGUI();
I've selected a Windows Forms Timer in order not to do Invokes and some
other multithreading stuff. And SerialPort component does not launches
events. I only use Write and Read method wihr 50 ms of timeout. I don't get
any execption.
Timer callback communicates with UI at startup, when scanning what devices
are present. Then it starts a no UI communication poll (and program locks
when doing no UI poll):
if(Initialized)
{
SendPoll();
WaitAck();
}
SendCommand and SendPoll composes a message and send it via Write() Serial
Port method.
WaitResponse and WaitAck, receives serial port stuff via Read() method.
What am I doing wrong?
--
Visita mi blog: http://rfog.blogsome.com
Libros, ciencia ficción y programación
========================================
Si alguien se vuelve para mirar tu traje, es que no vas bien vestido.
-- George Bryan Brummel. (1778-1840).