天天看點

PB中聲明、調用tuxedo方法

聲明例子:

Function Integer tpinit (Long TPINFO ) LIBRARY "wtuxws32.dll"

Function Integer tpterm () LIBRARY "wtuxws32.dll"

Function Integer tpcall (String SVCNAME , Long IDATA , Long ILEN, ref Long

ODATA ,ref Long OLEN , Long flags ) LIBRARY "wtuxws32.dll"

Function Integer tpacall (String SVCNAME , Long IDATA , Long

ILEN , Long flags ) LIBRARY "wtuxws32.dll"

Function Long tpalloc (String BUFTYPE , String SUBTYPE , Long

BUFSIZE ) LIBRARY "wtuxws32.dll"

Function Long tprealloc (Long buffer , Long BUFSIZE ) LIBRARY

"wtuxws32.dll"

Subroutine tpfree (Long buffer ) LIBRARY "wtuxws32.dll"

Function integer gettperrno() library "wtuxws32.dll"

Function integer getFerror() library "wtuxws32.dll"

Function Integer Fchg32( Long RCVBUF,long FLDID,long OCC,ref String value,ref

long LEN ) LIBRARY "wtuxws32.dll"

Function integer Fget32( Long RCVBUF,long FLDID,long OCC,ref String value,ref

long LEN) library"wtuxws32.dll"

Function integer Foccur32( Long fbfr,long FLDID) library"wtuxws32.dll"

程式中調用 tuxedo 例子:

tpinfo=tpalloc("TPINIT","",240)

tpalloc (String BUFTYPE , String SUBTYPE , Long BUFSIZE )

ret = tpinit(0)

if ret<0 then

   ret=gettperrno( )

   messagebox('資訊提示','tpinit error')

else

   reqbuf = tpalloc("FML32", "", 65535)

Fchg32(reqbuf,iv_gh_code,0,gv_gh,gh_len)//Fchg32( Long RCVBUF,long

FLDID,long OCC,ref String value,ref long LEN )

Fchg32(reqbuf,iv_fhy_code,0,gv_gh,fh_len)

Fchg32(reqbuf,iv_tx_code,0,gv_tx,gv_tx_len)

ret= tpcall("ADP_MILK",reqbuf,my_len,reqbuf,my_len,0)

if (ret<0) then

   ret=gettperrno( )

   retstr="tpcall:"+ tpstrerror(ret)

   messagebox('資訊提示',retstr)

else

   my_len=0

   Fget32(reqbuf,iv_zhye_code,0,ls_zhye,my_len)

   Fget32(reqbuf,iv_cwbm_code,0,is_error_code,my_len)

end if

   tpfree(reqbuf)

ret=tpterm()

end if

end if

繼續閱讀