这是航天信息提供的第三方接口vb范例,如何在VFP中调用,请各位高手指点
Private Sub Command_GETRETURN_Click()
Dim lngReturnValue As Long
Dim objTestATL As Object
Dim strOut As String
lngReturnValue = -1
lngReturnValue = PrntInterface1.GetPrntReturnData(strOut, lngReturnValue) '取返回数据
MsgBox (strOut)
End Sub
'功能:调用打印发票接口示例
Private Sub Command_PRNT_Click()
Dim lngReturnValue As Long
Dim objTestATL As Object
Dim strOut As String
Dim strInput As String '输入的开票数据 需要生成发票数据据
lngReturnValue = -1
lngReturnValue = PrntInterface1.PrntInv(strInput, lngReturnValue)
If lngReturnValue = 0 Then '打印成功
lngReturnValue = PrntInterface1.GetPrntReturnData(strOut, lngReturnValue) '取返回数据
Else
strOut = "错误代码是" & strOut
MsgBox (strOut)
End If
End Sub
'功能:调用读取发票数据接口示例
Private Sub Command_READINV_Click()
Dim lngReturnValue As Long
Dim objTestATL As Object
Dim strOut As String '输出的数据
lngReturnValue = -1
'开始调用获取发票信息接口
lngReturnValue = PrntInterface1.GetCurInv(strOut, lngReturnValue)
If lngReturnValue = 0 Then
MsgBox ("读取发票不成功")
ElseIf lngReturnValue = 1 Then '读取成功
MsgBox (strOut)
End If
End Sub
'功能:调用读取版本信息接口示例
Private Sub GetVersion_Click()
Dim lngReturnValue As Long
Dim objTestATL As Object
Dim strOut As String '输出的数据
lngReturnValue = -1
'开始调用获取发票信息接口
lngReturnValue = PrntInterface1.GetVersion(strOut, lngReturnValue)
If lngReturnValue = 0 Then
MsgBox ("读取版本信息不成功")
ElseIf lngReturnValue = 1 Then '读取成功
MsgBox (strOut)
End If
End Sub
Private Sub PreviewInv_Click()
Dim strTmp As String
Dim strOut As String
Dim lngReturnValue As Long
Dim objTestATL As Object
lngReturnValue = PrntInterface1.TestPreviewInv()
If lngReturnValue = 0 Then
MsgBox ("预览成功")
Else
strOut = "错误代码是" & lngReturnValue
MsgBox (strOut)
End If
End Sub
'此功能实现打印通道的测试,不需要输入任何数据。组件自动读取目录下的文件生成数据
Private Sub 打印测试_Click()
Dim strTmp As String
Dim strOut As String
Dim lngReturnValue As Long
Dim objTestATL As Object
lngReturnValue = PrntInterface1.TestPrnt(lngReturnValue)
If lngReturnValue = 0 Then
lngReturnValue = PrntInterface1.GetPrntReturnData(strOut, lngReturnValue)
MsgBox (strOut)
Else
strOut = "错误代码是" & lngReturnValue
MsgBox (strOut)
End If
End Sub