K
Kate Luu
Hi All,
First of all, My computer have only one comm port, and I did set up the port
as looping call back. I have one form with one button. When the form load, I
call WriteFile to open the port and then create a thread for reading back
the port if some thing arrive into the port. When I click the button, I
write the word: "Hello World" to the comm port. When data access the port,
the second thread was trigger. when the second thread read a first
character, its gave up its thread to its parent, it doesn't read the whole
thing as "Hello World". How can I prevent the second thread gave up its
thread to its parent until it's finish reading all the characters were came
to the port. Any help is greatly appreciated.
Kate Luu
First of all, My computer have only one comm port, and I did set up the port
as looping call back. I have one form with one button. When the form load, I
call WriteFile to open the port and then create a thread for reading back
the port if some thing arrive into the port. When I click the button, I
write the word: "Hello World" to the comm port. When data access the port,
the second thread was trigger. when the second thread read a first
character, its gave up its thread to its parent, it doesn't read the whole
thing as "Hello World". How can I prevent the second thread gave up its
thread to its parent until it's finish reading all the characters were came
to the port. Any help is greatly appreciated.
Kate Luu