你们网站提供的样本没有powerbuider的例子,我费了好大劲把一些常用的api转换称powerbuider声明的,但写出来后,有时可以打印,有时报The variable for type is error
a_prn_barcode()函数返回2367
大部分时候都不行,帮忙啊!
我的申明是:
Function ulong A_ClosePrn() Library "winppla.dll"
Function ulong A_CreatePrn(ulong item,ref string FileName) Library "winppla.dll"
Function ulong A_Print_Out(ulong width,ulong height,ulong copies,ulong amount) Library "Winppla.dll"
Function ulong A_Set_Darkness(ulong heat) Library "Winppla.dll"
Function ulong A_Prn_Barcode(ulong x,ulong y,ulong ori,ulong types,ulong narrow,ulong width,ulong height,ulong mode,ulong num,ref string data) Library "Winppla.dll"
Function ulong A_Prn_text(ulong x,ulong y,ulong ori,ulong font,ulong types,ulong hor,ulong ver,string mode,ulong numeric,ref string data) Library "Winppla.dll"
Function ulong A_Clear_Memory() Library "Winppla.dll"
代码为:
//试验
string ls_filename,ls_type,ls_mode,ls_name
blob b_type,b_mode
ls_filename = 'outfile.prn'
b_type = blob('a')
b_mode = blob('A')
ls_name = '1456'
a_createPrn(1,ls_filename)
a_clear_memory()
a_set_darkness(10)
long i
i = a_prn_barcode(0, 0, 1, 89, 0, 0, 24, 63, 0, ls_name)
if i <> 0 then
a_closeprn()
messagebox("三金软件","error" + ' ' + string(i))
return
end if
a_print_out(1,1,1,2)
a_closeprn()
|
|