Hi!
I'm programming an aplication to connect with a machine by Serial Port. I would like to show the answer that this machine give me (I read it with ReadFile() ).
For example, If I read:
HANDLE Comm;
CString COM = "COM1";
BOOL Read;
DWORD iBytesRead;
char sBuffer[128];
char msg[255];
Read = ReadFile(Comm, &sBuffer, 1, &iBytesRead, NULL);
sprintf(msg , "Response:%s", sBuffer);
m_ctlRecvd.AddString(msg);
UpdateData(FALSE);
Thanks!!!!

ReadFile()?
jason_czb
SpringTime
Mickey Gousset
Christoph_S
Thanks!
And the last question: how can I show in my monitor the message I read with ReadFile()
Darmadi Komo
sBuffer[iBytesRead] = 0;
printf("Response:%s\n", sBuffer);
In a Windows program, put it in a editbox with SendMessage(WM_SETTEXT)
mil10
Sorry! I forgot to explain all. I don't know how can I show in my monitor the message that the machine answer me.
I know that I have to make createFile and configure cbd. But I didn't want to bored you with a big code ;)
So, if the machine response "OK", how many times Should I call ReadFile How Can I know it
Thanks!