医联卡DLL

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,ActiveX;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Memo1: TMemo;
    Memo2: TMemo;
    Memo3: TMemo;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
function hdcService(head,body,msg,resultdata:string):integer;stdcall;external 'hdcv1.dll';
procedure TForm1.Button1Click(Sender: TObject);
var
rst:integer;
head,body,msg,resultdata:string;

begin
memo3.Text :='Now connecting .....';  update;
 setLength(msg,255);
setLength(resultdata,2000);
head:=memo1.Text ;
body:=memo2.Text ;
rst:=hdcService(PChar(head),PChar(body),PChar(msg),resultdata);
if rst<>0 then memo3.Text :=msg else memo3.Text :=resultdata ;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
//CoInitialize(nil)
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
//CoUninitialize
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
memo1.Text :='<header><eventid>Q01</eventid><organizationid>8080</organizationid></header>';
memo2.Text :='<body><query id="2"><param  id="sfzh">3623241980042128812</param></query></body>';

end;

initialization
Coinitialize(nil);
finalization
CoUninitialize; 

posted on 2009-09-08 22:58  舟山牙医  阅读(170)  评论(0编辑  收藏  举报

导航