hi, mate, i download this component, compile, and insert into my new project, but have
not any info about how to use it. what is functions for reading, writing, flags and other
info to use. can you make a simple example for most used functions and flags with this
component. thanks in advance
i make a simple aplication with one combox and one buton"send" but i dont know what
a function need to use and flags to use this component. here in forum can not post a
picture, may be i am a new member
I really should have cleaned that code up before posting.
Anyway, the idea is that you should drop the component on your form and then edit its properties. Example:
PortName \\.\COM2
BaudRate bd9600
ByteSize bs8
Parity paNo
StopBits sb1_0
etc...
... and set the event handlers. Most events are direct translations of this:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa363435(v=vs.85).aspx
Example, create an "OnRxchar" (EV_RXCHAR in the MSDN documentation) event handler to handle incomming characters.
In addition to the events described in the MSDN SetCommMask() documentation, these are available:
OnOpened - When the com port is successfully opened.
OnClosed When it's closed.
OnError - For misc. errors. Use GetLastError() to figure out what's happened.
Use the Open() method to open the com port and Close() to close it.
Use the
DWORD Write(LPVOID lpBuffer, DWORD nNumberOfBytesToWrite )
method to send data. It returns the number of bytes actaully sent.
Use the
DWORD Read( LPVOID lpBuffer, DWORD nNumberOfBytesToRead )
method to read data. It returns the number of bytes actaully read.
Br,
Ted
Connect with Us