PSafeArray(100分)

  • 主题发起人 主题发起人 sharewe
  • 开始时间 开始时间
S

sharewe

Unregistered / Unconfirmed
GUEST, unregistred user!
以下是VB中的代吗:
'采集记录
Dim TX_End As Long '通讯结果
Dim Record_Num As Long '采集回来的记录数
Dim Record_SKY(18) As Long '收款员代号
Dim Record_Date(18) As String '记录日期
Dim Record_Card(18) As String '卡
Dim Record_Type(18) As Long '类型
Dim Record_XF_Now(18) As Long '金额
Dim Record_Mach_Liu(18) As Long '机流水
Dim Record_Mach_Num(18) As Long '消费机号

Record_Num = 0
Do
If Option2.Value = True then
'TCP/IP
TX_End = Me.OFW1_OCX1.Get_Record_ALL(Text2.Text, Text1.Text, 1000, Text4.Text, Record_Num, Record_Num, _
Record_SKY(), Record_Date(), Record_Card(), Record_Type(), Record_XF_Now(), Record_Mach_Liu(), Record_Mach_Num())
else
'串口通讯
TX_End = Me.OFW1_OCX1.Get_Record_ALL(Combo1.Text, Text1.Text, 1000, Text4.Text, Record_Num, Record_Num, _
Record_SKY(), Record_Date(), Record_Card(), Record_Type(), Record_XF_Now(), Record_Mach_Liu(), Record_Mach_Num())
End If
If TX_End = 0 then

If Record_Num = 0 then

MsgBox "Successful! 记录已采集完成!"
Exit Sub
else

MsgBox "Successful!本次已采集 [ " &
Record_Num &
" ] 条数据" &
_
vbCrLf &
"第1条 收款员" &
Record_SKY(1) &
"|" &
"时间" &
Record_Date(1) &
"|" &
"卡" &
Record_Card(1) &
"|" &
"类型" &
Record_Type(1) &
"|" &
"金额" &
Record_XF_Now(1) &
"|" &
"机流水" &
Record_Mach_Liu(1) &
"|" &
"消费机号" &
Record_Mach_Num(1) &
_
vbCrLf &
"第2条 收款员" &
Record_SKY(2) &
"|" &
"时间" &
Record_Date(2) &
"|" &
"卡" &
Record_Card(2) &
"|" &
"类型" &
Record_Type(2) &
"|" &
"金额" &
Record_XF_Now(2) &
"|" &
"机流水" &
Record_Mach_Liu(2) &
"|" &
"消费机号" &
Record_Mach_Num(2) &
_
vbCrLf &
"第3条 收款员" &
Record_SKY(3) &
"|" &
"时间" &
Record_Date(3) &
"|" &
"卡" &
Record_Card(3) &
"|" &
"类型" &
Record_Type(3) &
"|" &
"金额" &
Record_XF_Now(3) &
"|" &
"机流水" &
Record_Mach_Liu(3) &
"|" &
"消费机号" &
Record_Mach_Num(3) &
_
vbCrLf &
"第4条 收款员" &
Record_SKY(4) &
"|" &
"时间" &
Record_Date(4) &
"|" &
"卡" &
Record_Card(4) &
"|" &
"类型" &
Record_Type(4) &
"|" &
"金额" &
Record_XF_Now(4) &
"|" &
"机流水" &
Record_Mach_Liu(4) &
"|" &
"消费机号" &
Record_Mach_Num(4) &
_
vbCrLf &
"第5条 收款员" &
Record_SKY(5) &
"|" &
"时间" &
Record_Date(5) &
"|" &
"卡" &
Record_Card(5) &
"|" &
"类型" &
Record_Type(5) &
"|" &
"金额" &
Record_XF_Now(5) &
"|" &
"机流水" &
Record_Mach_Liu(5) &
"|" &
"消费机号" &
Record_Mach_Num(5) &
_
vbCrLf &
"第6条 收款员" &
Record_SKY(6) &
"|" &
"时间" &
Record_Date(6) &
"|" &
"卡" &
Record_Card(6) &
"|" &
"类型" &
Record_Type(6) &
"|" &
"金额" &
Record_XF_Now(6) &
"|" &
"机流水" &
Record_Mach_Liu(6) &
"|" &
"消费机号" &
Record_Mach_Num(6) &
_
vbCrLf &
"第7条 收款员" &
Record_SKY(7) &
"|" &
"时间" &
Record_Date(7) &
"|" &
"卡" &
Record_Card(7) &
"|" &
"类型" &
Record_Type(7) &
"|" &
"金额" &
Record_XF_Now(7) &
"|" &
"机流水" &
Record_Mach_Liu(7) &
"|" &
"消费机号" &
Record_Mach_Num(7) &
_
vbCrLf &
"第8条 收款员" &
Record_SKY(8) &
"|" &
"时间" &
Record_Date(8) &
"|" &
"卡" &
Record_Card(8) &
"|" &
"类型" &
Record_Type(8) &
"|" &
"金额" &
Record_XF_Now(8) &
"|" &
"机流水" &
Record_Mach_Liu(8) &
"|" &
"消费机号" &
Record_Mach_Num(8) &
_
vbCrLf &
"第9条 收款员" &
Record_SKY(9) &
"|" &
"时间" &
Record_Date(9) &
"|" &
"卡" &
Record_Card(9) &
"|" &
"类型" &
Record_Type(9) &
"|" &
"金额" &
Record_XF_Now(9) &
"|" &
"机流水" &
Record_Mach_Liu(9) &
"|" &
"消费机号" &
Record_Mach_Num(9)

MsgBox "第10条 收款员" &
Record_SKY(10) &
"|" &
"时间" &
Record_Date(10) &
"|" &
"卡" &
Record_Card(10) &
"|" &
"类型" &
Record_Type(10) &
"|" &
"金额" &
Record_XF_Now(10) &
"|" &
"机流水" &
Record_Mach_Liu(10) &
"|" &
"消费机号" &
Record_Mach_Num(10) &
_
vbCrLf &
"第11条 收款员" &
Record_SKY(11) &
"|" &
"时间" &
Record_Date(11) &
"|" &
"卡" &
Record_Card(11) &
"|" &
"类型" &
Record_Type(11) &
"|" &
"金额" &
Record_XF_Now(11) &
"|" &
"机流水" &
Record_Mach_Liu(11) &
"|" &
"消费机号" &
Record_Mach_Num(11) &
_
vbCrLf &
"第12条 收款员" &
Record_SKY(12) &
"|" &
"时间" &
Record_Date(12) &
"|" &
"卡" &
Record_Card(12) &
"|" &
"类型" &
Record_Type(12) &
"|" &
"金额" &
Record_XF_Now(12) &
"|" &
"机流水" &
Record_Mach_Liu(12) &
"|" &
"消费机号" &
Record_Mach_Num(12) &
_
vbCrLf &
"第13条 收款员" &
Record_SKY(13) &
"|" &
"时间" &
Record_Date(13) &
"|" &
"卡" &
Record_Card(13) &
"|" &
"类型" &
Record_Type(13) &
"|" &
"金额" &
Record_XF_Now(13) &
"|" &
"机流水" &
Record_Mach_Liu(13) &
"|" &
"消费机号" &
Record_Mach_Num(13) &
_
vbCrLf &
"第14条 收款员" &
Record_SKY(14) &
"|" &
"时间" &
Record_Date(14) &
"|" &
"卡" &
Record_Card(14) &
"|" &
"类型" &
Record_Type(14) &
"|" &
"金额" &
Record_XF_Now(14) &
"|" &
"机流水" &
Record_Mach_Liu(14) &
"|" &
"消费机号" &
Record_Mach_Num(14) &
_
vbCrLf &
"第15条 收款员" &
Record_SKY(15) &
"|" &
"时间" &
Record_Date(15) &
"|" &
"卡" &
Record_Card(15) &
"|" &
"类型" &
Record_Type(15) &
"|" &
"金额" &
Record_XF_Now(15) &
"|" &
"机流水" &
Record_Mach_Liu(15) &
"|" &
"消费机号" &
Record_Mach_Num(15) &
_
vbCrLf &
"第16条 收款员" &
Record_SKY(16) &
"|" &
"时间" &
Record_Date(16) &
"|" &
"卡" &
Record_Card(16) &
"|" &
"类型" &
Record_Type(16) &
"|" &
"金额" &
Record_XF_Now(16) &
"|" &
"机流水" &
Record_Mach_Liu(16) &
"|" &
"消费机号" &
Record_Mach_Num(16) &
_
vbCrLf &
"第17条 收款员" &
Record_SKY(17) &
"|" &
"时间" &
Record_Date(17) &
"|" &
"卡" &
Record_Card(17) &
"|" &
"类型" &
Record_Type(17) &
"|" &
"金额" &
Record_XF_Now(17) &
"|" &
"机流水" &
Record_Mach_Liu(17) &
"|" &
"消费机号" &
Record_Mach_Num(17)
End If
else

MsgBox "Unsuccessful!"
Exit Sub
End If
Loop

以下是Delphi中的申明:
function TOFW1_OCX.Get_Record_ALL(const STS_IP: WideString;
const STS_Chang: WideString;

STS_Wait: Integer;
const STS_Password: WideString;

GRA_ZhiZheng: Integer;
var GRA_Num: Integer;

var GRA_SKY: PSafeArray;
var GRA_Date: PSafeArray;

var GRA_Card: PSafeArray;
var GRA_Type: PSafeArray;

var GRA_XF_Now: PSafeArray;
var GRA_Mach_Liu: PSafeArray;

var GRA_Mach_Now: PSafeArray): Integer;
begin

Result := DefaultInterface.Get_Record_ALL(STS_IP, STS_Chang, STS_Wait, STS_Password,
GRA_ZhiZheng, GRA_Num, GRA_SKY, GRA_Date, GRA_Card,
GRA_Type, GRA_XF_Now, GRA_Mach_Liu, GRA_Mach_Now);
end;


请问我在Delphi7中如何调用这个函数能收回数据,主要是PSafeArray类型不会使用,请各位大侠帮帮手~~~~
 
各位高手帮帮忙啊,分不够可再加~~~急着要用~~~
 
后退
顶部