Duebel
asked on
Serial communication with Win32
I need to send and receive data over a serial connection. How can I access the comm ports under Windows 95 and NT and how can I send data over such a connection. Please provide some sample code or give me an URL where I can find more informations. (I need something like a terminal app.)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
procedure OpenCom1;
begin
Port:='COM1';
hPort:=CreateFile(PChar(Po
end;
// This is to send a stream of chars to comm port
procedure WriteToCom1(S: string);
var ByteWritten: longword;
begin
WriteFile(hPort, PChar(S)^, Length(S), ByteWritten, nil);
end;
procedure CloseCom1;
begin
CloseHandle(hPort);
end;
Consult your Windows SDK help in your Delphi (Help|Windows SDK) or simple press F1 in the function for more detail about function's parameters. :)
Donny