procedure TForm1.Button1Click(Sender: TObject);
LongInt ): Pointer; stdcall;
var
SndBuf : PTFbfr;
RcvBuf :PTFbfr;
ret :integer;
lBillCount :longint;
fRecNum :single;
fDeposit:single;
lNumLong:longint;
BILLCOUNT,RECNUM,DEPOSIT,NUMLONG :FLDIDD32;
SvcName:array[1..20] of char;
Ilen: LongInt;
Olen: PLongInt;
lFlag :longint;
Tpinfo: PTTpinit;
begin
tuxputenv('WSNADDR=//wsy:6060');
Tpinfo :=nil;
ret := tpinit(Tpinfo);
if (ret < 0) then
begin
application.MessageBox(pchar(inttostr(ret)),'tpinit error',MB_OK);
application.MessageBox(pchar (inttostr(gettperrno)),'tpinit error',MB_ OK);
end;
SndBuf := tpalloc('FML32',nil,1024);
if (SndBuf = nil) then
begin
application.MessageBox('','error in tpalloc SndBuf',MB_OK);
tpterm();
exit;
end;
Rcv Buf := tpalloc('FML32',nil,1024);
if (RcvBuf = nil) then
begin
application.MessageBox('','error in tpalloc RcvBuf',MB_OK);
tpfree(pchar(Sndbuf));
tpterm();
exit;
end;
BILLCOUNT :=33556580;
lBillCount := 1680;
Value: Pointer; Len: FLDLEN32 ): Integer; stdcall;
ret :=Fchg32(SndBuf,BILLCOUNT,0,@lBillCount,0);
if (ret < 0) then
begin
application.MessageBox('Fchg32 lo ng error','Fchg32 long error',MB_OK);
tpfree(pchar(SndBuf));
tpfree(pchar(RcvBuf));
tpterm();
exit;
end;
RECNUM := 100665536;
fRecNum := 60.96;
ret :=Fchg32(Sn dBuf,RECNUM,0,@fRecNum,0);
if (ret < 0) then
begin
application.MessageBox('Fchg32 long error','Fchg32 double RECNUM
error',MB_OK);
tpfree(pchar(Sndbuf));
tpfree(pchar(RcvBuf));
tpterm();
exit;
end;
Ilen := 0;
Olen := 0;
lFlag :=0;
{
strcopy(@SvcName,pchar( 'FMLTMP'));
ret := tpcall (@SvcName,pchar(SndBuf),Ilen,@SndBuf,Olen,TPNOTRAN);
}
ret := tpcall ('FMLTMP',pchar(SndBuf),0,@SndBuf,0,0);
if (ret < 0) then
begin
application.MessageBox(pchar(inttostr(ret)),'tpcall error',MB_OK);
application.MessageBox(pchar (inttostr(gettperrno)),'tpcall error',MB_OK);
application.MessageBox(tpstrerror(gettperrno),'tpcall error',MB_OK);
tpfree(pchar(SndBuf));
tpfree(pchar(RcvBuf));
tpterm();
exit;
end;
DEPOSIT := 100665348;
ret:= Fget32(SndBuf,DEPOSIT,0,@fDeposit,0);
if (ret < 0) then
begin
application.MessageBox(pchar(inttostr(ret)),'Fget32 float DEPOSIT
error',MB_OK);
application.MessageBox(pchar (inttostr(gettperrno)),'Fget32 float
DEPOSIT error',MB_OK);
application.MessageBox(tpstrerror(gettperrno),'Fget32 float DEPOSIT
error',MB_OK);
tpfree(pchar(SndBuf));
tpfree(pchar(RcvBuf));
tpterm();
exit;
end;
application.MessageBox(pchar(floattostr(fDeposit)),'Fget32 float DEPOSIT
value ',MB_OK);
NUMLONG := 33556847;
ret := Fget32(SndBuf,NUMLONG,0,@lNumLong,0);
if (ret < 0) then
begin
applicatio n.MessageBox(pchar(inttostr(ret)),'Fget32 long NUMLONG
error',MB_OK);
application.MessageBox(pchar (inttostr(gettperrno)),'Fget32 long
NUMLONG error',MB_OK);
application.MessageBox(tpstrerror(gettperrno),'Fget32 long NUMLONG
error',MB_OK);
tpfree(pchar(SndBuf));
tpfree