die
dll die auf dem echtem pc geht: RSCOM.dll
unit dazu(RSCOMdec.pas):
Delphi-Quellcode:
unit RSCOMdec;
interface
uses windows;
Function OPENCOM(OpenString:PChar):Integer;
stdcall;
external '
RSCOM.DLL';
Procedure TIMEOUTS (TOut: Integer);
stdcall;
external '
RSCOM.DLL';
Procedure BUFFERSIZE (Size: Integer);
stdcall;
external '
RSCOM.DLL';
Procedure CLOSECOM();
stdcall;
external '
RSCOM.DLL';
Procedure SENDBYTE (Dat: Integer);
stdcall;
external '
RSCOM.DLL';
Function READBYTE (): Integer;
stdcall;
external '
RSCOM.DLL';
Procedure SENDSTRING (Buffer: PChar);
stdcall;
external '
RSCOM.DLL';
Function READSTRING (): PChar;
stdcall;
external '
RSCOM.DLL';
Procedure CLEARBUFFER ();
stdcall;
external '
RSCOM.DLL';
Function INBUFFER (): DWORD;
stdcall;
external '
RSCOM.DLL';
Function OUTBUFFER (): DWORD;
stdcall;
external '
RSCOM.DLL';
Procedure DTR(d:WORD);
stdcall;
external '
RSCOM.DLL';
Procedure RTS(d:WORD);
stdcall;
external '
RSCOM.DLL';
Procedure TXD(d:WORD);
stdcall;
external '
RSCOM.DLL';
Function CTS:Integer;
stdcall;
external '
RSCOM.DLL';
Function DSR:Integer;
stdcall;
external '
RSCOM.DLL';
Function RI:Integer;
stdcall;
external '
RSCOM.DLL';
Function DCD:Integer;
stdcall;
external '
RSCOM.DLL';
function INPUTS():Integer;
stdcall;
external '
RSCOM.DLL';
procedure TIMEINIT();
stdcall;
external '
RSCOM.DLL';
function TIMEREAD(): Real;
stdcall;
external '
RSCOM.DLL';
procedure DELAY(DelayTime: Real);
stdcall;
external '
RSCOM.DLL';
procedure REALTIME();
stdcall;
external '
RSCOM.DLL';
procedure NORMALTIME();
stdcall;
external '
RSCOM.DLL';
implementation
end.
und meine
Unit:
Delphi-Quellcode:
uses
RSCOMdec.pas
procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
begin
for i := 1 to 255 do
begin
s := s+char(readbyte);
application.ProcessMessages;
end;
memo1.lines.strings[0]:=s;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
CloseCOM;
close;
end;
procedure TForm1.FormCreate(Sender: TObject);
var openstring: string;
begin
Openstring := 'COM5:4800,N,8,1';
OPENCOM (pchar (Openstring));
end;
der ppc gibt als fehler einfach "keine gültige PocketPC-Anwendung"