vc++ com1 read

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
mattyork
LCD?
Posts: 2
Joined: Tue Sep 30, 2003 8:13 pm
Location: vancouver

vc++ com1 read

Post 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

Johnny1
Matrix Orbital
Matrix Orbital
Posts: 23
Joined: Tue Dec 10, 2002 1:23 pm
Contact:

Post 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

Code: Select all

_beginthreadex
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.
Johnny Patino
Software Developer
Matrix Orbital

Post Reply