如何在我自己的空间中捆绑spcomm
贴上部分代码,
type
TZkjjLink = class(TWinControl)
private
FComm1:TComm;
FImage1:TImage;
FStr1:String;
FStr2:String;
FStr3:String;
FStr4:String;
FStr5:String;
FViewString:String;
rbuf:array[1..6] of byte;
procedure FComm1ReceiveData(Sender: TObject; Buffer: Pointer; BufferLength: Word);
function GetByte(Bit: array of longint ): Byte; //为转换为字节;
function rev(c: Byte):Byte;stdcall;
function ones(ch: Byte):Byte;stdcall;
function verify(addr,order:Byte):Byte;
procedure send_data(ch: Byte);stdcall;
procedure send_addr(ch: Byte);stdcall;
procedure send_order(ch: Byte);stdcall;
{ Private declarations }
protected
{ Protected declarations }
public
Constructor Create(AOwner:TComponent);override;
destructor Destroy;override;
function DisBmp(FileStr : String; ComN : String; Address : Integer) : Integer;
function DispLine(strto : String; ComN : String; Address : Integer) : Integer;
function DisTxt(FileStr : String; ComN : String; Address : Integer) : Integer;
{ Public declarations }
published
property Visible;
{ Published declarations }
end;
constructor TZkjjLink.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FStr1 :='';
FStr2 :='';
FStr3 :='';
FStr4 :='';
FStr5 :='';
// Self.Hide;
FComm1 :=TComm.Create(self);
FComm1.OnReceiveData:=FComm1ReceiveData;
FComm1.BaudRate:=57600;
FComm1.ParityCheck:=True;
FImage1:=TImage.Create(self);
FImage1.Parent:=self;
end;
OnReceiveData不能响应