H
HNXXCXG
Unregistered / Unconfirmed
GUEST, unregistred user!
使用厂家的DLL
我的代码:
{*******************************************************}
{ }
{ 陈新光 }
{ }
{ 版权所有 (C) 2007 咏南工作室 }
{ }
{*******************************************************}
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
btn1: TButton;
btn2: TButton;
edt1: TEdit;
btn3: TButton;
lbl1: TLabel;
procedure btn3Click(Sender: TObject);
procedure btn2Click(Sender: TObject);
procedure btn1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
function RTr2card(comn:string;out inTr2str:string):Integer;stdcall;external'rwcommnew.dll';
function WTr2card(comn,inTr2str:string):Integer;stdcall;external'rwcommnew.dll';
function RTr3card(comn,inTr3str:string):Integer;stdcall;external'rwcommnew.dll';
function WTr3card(comn,inTr3str:string):Integer;stdcall;external'rwcommnew.dll';
function RTr23card(comn,inTr2str,inTr3str:string):Integer;stdcall;external'rwcommnew.dll';
function WTr23card(comn,inTr2str,inTr3str:string):Integer;stdcall;external'rwcommnew.dll';
implementation
{$R *.dfm}
procedure TForm1.btn3Click(Sender: TObject);
begin
edt1.Clear;
end;
procedure TForm1.btn2Click(Sender: TObject);
begin
if WTr2card('com1',edt1.Text)<>1 then
ShowMessage('error');
end;
procedure TForm1.btn1Click(Sender: TObject);
begin
if RTr3card('com1',edt1.Text)<>1 then
ShowMessage('error')
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
edt1.Text:='7758520';
end;
end.
我的代码:
{*******************************************************}
{ }
{ 陈新光 }
{ }
{ 版权所有 (C) 2007 咏南工作室 }
{ }
{*******************************************************}
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
btn1: TButton;
btn2: TButton;
edt1: TEdit;
btn3: TButton;
lbl1: TLabel;
procedure btn3Click(Sender: TObject);
procedure btn2Click(Sender: TObject);
procedure btn1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
function RTr2card(comn:string;out inTr2str:string):Integer;stdcall;external'rwcommnew.dll';
function WTr2card(comn,inTr2str:string):Integer;stdcall;external'rwcommnew.dll';
function RTr3card(comn,inTr3str:string):Integer;stdcall;external'rwcommnew.dll';
function WTr3card(comn,inTr3str:string):Integer;stdcall;external'rwcommnew.dll';
function RTr23card(comn,inTr2str,inTr3str:string):Integer;stdcall;external'rwcommnew.dll';
function WTr23card(comn,inTr2str,inTr3str:string):Integer;stdcall;external'rwcommnew.dll';
implementation
{$R *.dfm}
procedure TForm1.btn3Click(Sender: TObject);
begin
edt1.Clear;
end;
procedure TForm1.btn2Click(Sender: TObject);
begin
if WTr2card('com1',edt1.Text)<>1 then
ShowMessage('error');
end;
procedure TForm1.btn1Click(Sender: TObject);
begin
if RTr3card('com1',edt1.Text)<>1 then
ShowMessage('error')
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
edt1.Text:='7758520';
end;
end.