Hello!
I am working on a simple program 4 read/write operations to a serial port. I set up everything and it all goes well to the point where I start a separate thread to monitor the port with the SetCommMask and WaitCommEvent functions.
The writing is working fine. When I start the tread which monitors the port, I cannot write to it unless I send sth back. I am using functions CreateFile, ReadFile etc and they are all from examples within the help.
So everything IS working, the writing, the reading ... but I can only either write or read ... if I want to send some data while waiting for an event with WaitCommEvent in another thread I simply cannot but if a send sth back the data is received and then the char is also sent.
Can I raise any event monitored by the WaitCommEvent by hand so that it releses the I don't know whatever the function is holding to and then I could do the job within the same thread, I would just specify that the data must be sent and in an if clause he would sent it and then go back waiting for the data. Or must I do sth. before the EriteFile?
I've been searching the solution for 2 days now and no luck.
Thanx!
I am working on a simple program 4 read/write operations to a serial port. I set up everything and it all goes well to the point where I start a separate thread to monitor the port with the SetCommMask and WaitCommEvent functions.
The writing is working fine. When I start the tread which monitors the port, I cannot write to it unless I send sth back. I am using functions CreateFile, ReadFile etc and they are all from examples within the help.
So everything IS working, the writing, the reading ... but I can only either write or read ... if I want to send some data while waiting for an event with WaitCommEvent in another thread I simply cannot but if a send sth back the data is received and then the char is also sent.
Can I raise any event monitored by the WaitCommEvent by hand so that it releses the I don't know whatever the function is holding to and then I could do the job within the same thread, I would just specify that the data must be sent and in an if clause he would sent it and then go back waiting for the data. Or must I do sth. before the EriteFile?
I've been searching the solution for 2 days now and no luck.
Thanx!