Page 1 of 1
vc++ com1 read
Posted: Sun Oct 05, 2003 10:26 pm
by mattyork
hi, i am looking for some help with reading from the com1 port in vc++. This will be used for the keypad input on my LK204-25 lcd module. If anyone can help me with how to run the code as a seperate thread that would be great too. Thanks very much, matt
Posted: Mon Oct 06, 2003 9:49 am
by Johnny1
Hi Matt, have you looked at the links I posted here ->
http://www.lcdforums.com/forums/viewtop ... =9298#9298
...how to run the code as a separate thread...
To spawn a new thread use function
Check your MSDN library for complete details about this function.
In the sample code I mentioned in the link above, the new thread is spawned in the file
SerialCommHelper.cpp line 160
Code: Select all
m_hThread = (HANDLE)_beginthreadex(0,0,CSerialCommHelper::ThreadFn,(void*)this,0,0 );
Try reading the article linked above, and download their sample code. Then step through the code step-by-step and if you still have problems please let me know. I hope this helps.