I'm trying to use serial port in asynchronous mode,using overlapped structures and event handlers.
signals waiting thread ,when received bytes counts to "BytesToReceive. Ok. But i dont know how many bytes will come. One solution is to set BytesToReceive=1. Its not elegant. Other way is to use timeouts. Then ReadFile signals to waiting thread.
Other -3th- way is to use EvtChar, in my case i know every received packet ends with known character.
I settled event structures and received notification on EV_RXLAG . But how to handle properly?
When this event happens, there are ,let say 10 received bytes, but ReadFile is called with BytesToreceive=100.
I didnt find explanation how to cancel ReadFile and get these 10 bytes.
Any help is welcome!
You should use the default value of 1 so that you get signalled on every byte received. You then transfer each byte to some data buffer which you later process when you have received a minimum number of bytes or when you are able to recognise that a complete message has been received.
I save and restore shortcut (*.lnk and position on desktop) automatically at logoff/logon on the desktop of our users.
It work perfectly but... at first logon for any users, the position is not applied... It work at second logon (and next).
Someone have an explanation?
I have tried to refresh desktop, registry,...