I\'m working on a small component for writing and reading AT Commands using an old Sony Ericsson phone. Sending and writing to/from the phone is no problem at all, however I
Any time you need to call Application.ProcessMessages()
manually, you need to rethink your code design. Doubly so when calling it in a loop.
I do not know how Asynch Pro works, but the Win32 API has a WaitCommEvent()
function that does what you are asking for. You call that function to ask the serial port for notification of the desired event(s) and then you can use either WaitForOverlappedResult()
or WaitForSingleObject()
to wait for those events to actually occur, depending on whether the serial port is operating in overlapped mode or not. No message processing is needed. I would be surprised if Asynch Pro does not somehow expose that functionality.