Serial Comm. in VC++

A

Thread Starter

asif qaiyum

Hi everyone,
Can anyone give me the way how to perform serial communication in VC++? I have successfully implement it in VB.

Please guide me.
With thanks
Asif qaiyum
 
R

Rainer Lehrig

Use:

CreateFile("COM1",...);
SetCommConfig(...); // baudrate ...
WriteFile(...);
ReadFile(...);
CloseHandle(...);

Example:
for ( ; ; ) {
if (WaitCommEvent(hComm, &dwCommEvent, NULL)) {
do {
if (ReadFile(hComm, &chRead, 1, &dwRead, NULL))
// A byte has been read; process it.
else
// An error occurred in the ReadFile call.
break;
} while (dwRead);
}
else
// Error in WaitCommEvent
break;
}

See: MSDN
 
Hi Asif,

can u please help me in giving the information about the serial communication in VB? and i do want to read the series of numbers through the serial port.

i need this help as early as possible.

u can contact me by [email protected]
 
Hi Asif,

can u please help me in giving the information about the serial communication in VB? and i do want to read the series of numbers through the serial port. mail me by [email protected]

Thanks
 
K

Ketan P Bhaid

use Microsoft MSCOMM control you will find it in
project menu >> Components
its ActiveX Control.

you will find more details in MSDN or Black book.
 
Top