WriteFile( FComPortHandle, DataPtr^, nToSend, nSent, nil );
여기서 nil에 Types of actual and formal var parameters must be identical 이라고 나오는데
델파이 6 쓰고 있거든요..
알려주시면 감사하겠습니다.
function TCommPortDriver.SendDataEx( DataPtr: pchar; DataSize, Timeout: UINT ): UINT;
var nToSend, nSent: integer;
t1: longint;
begin
{ Do nothing if port has not been opened }
Result := 0;
if not Connected then
exit;
{ Current time }
t1 := GetTickCount;
{ Loop until all data sent or timeout occurred }
while DataSize > 0 do
begin
{ Get TX buffer free space }
nToSend := OutFreeSpace;
{ If output buffer has some free space... }
if nToSend > 0 then
begin
{ Check signals }
if FCkLineStatus and (GetLineStatus = []) then
exit;
{ Don't send more bytes than we actually have to send }
if nToSend > DataSize then
nToSend := DataSize;
{ Send }
WriteFile( FComPortHandle, DataPtr^, nToSend, nSent, nil );
nSent := abs( nSent );
if nSent > 0 then
begin
{ Update number of bytes sent }
Result := Result + nSent;
{ Decrease the count of bytes to send }
DataSize := DataSize - nSent;
{ Inc. data pointer }
DataPtr := DataPtr + nSent;
{ Get current time }
t1 := GetTickCount;
{ Continue. This skips the time check below (don't stop
trasmitting if the Timeout is set too low) }
continue;
end;
end;
{ Buffer is full. If we are waiting too long then exit }
if (GetTickCount-t1) > Timeout then
exit;
end;
end;
파일은 여기에 있습니다..
http://www.kosma.co.kr/~domine/down/vcl/cd320108.zip