So sieht der Code im aktuellen TComport aus.
Delphi-Quellcode:
// perform asynchronous write operation
function TCustomComPort.WriteStrAsync(const Str: string; var AsyncPtr: PAsync): Integer;
var sa : Ansistring;
begin
if Length(Str) > 0 then
begin
sa := AnsiString(str);
Result := WriteAsync(Sa[1], Length(Str), AsyncPtr)
end
else
Result := 0;
end;
// perform synchronous write operation
function TCustomComPort.WriteStr(const Str: string): Integer;
var
AsyncPtr: PAsync;
begin
InitAsync(AsyncPtr);
try
WriteStrAsync(Str, AsyncPtr);
Result := WaitForAsync(AsyncPtr);
finally
DoneAsync(AsyncPtr);
end;
end;
Bringt uns das weiter?