Re: serial ports handling


[ Related Articles and Replies ] [ Post Followup ] [ DelphiLand Discussion Forum ]

Posted by Michu on January 29, 2003 at 09:22:56:

In Reply to: serial ports handling posted by Laetitia on January 03, 2003 at 16:38:26:

: Hi !

: I have been trying to send to and receive strings from my serial port using a demo written by Peter Johnson and Delphi 6.0. Here are a few important statements of it:

:...

: if not WriteFile (ComFile, s[1], Length(s), BytesWritten, Nil) then
: { Raise an exception }

: When I try to compile the code, this last statement makes Delphi issue the following error message:

: [Error] Unit1.pas(95): Types of actual and formal var parameters must be identical

: Can anyone give me a tip on this problem ?

: Many thanks

: Laetitia


Hi!
Try to define BytesWritten as dWord.
-> See API-Help for info.

I keep on trying the same demo from P. Johnson (->Link).
This was the first problem for me too, but now I get a failure when running at this:

Config := 'baud=19200 parity=n data=8 stop=1' + NULL;
BuildCommDCB(@Config[1], DCB);


{???}
:-)
Ciao!




Related Articles and Replies:


[ Related Articles and Replies ] [ Post Followup ] [ DelphiLand Discussion Forum ]