VB调用C++编写的dll,当函数参数为数组时该如何调用? 5
dll中的函数为:extern"C"_declspec(dllexport)intc_Test(floatax[7],floatax_0[7])在VB中想调用这个函数,之...
dll 中的函数为:
extern "C" _declspec (dllexport) int c_Test(float ax[7],float ax_0[7])
在VB中想调用这个函数,之前写了如下代码总是报错,想知道正确的调用方法,希望大神帮
能指点一下,万分感谢。
Private Declare Function c_Test Lib "c:\collision.dll" (ByRef a() As Single, ByRef a_0() As Single) As Long
Private Sub Command1_Click()
Dim b(7) As Single
Dim b_0(7) As Single
For i = 0 To 7
b(i) = 1
b_0(i) = 1
Next i
Label1.Caption = c_Test(b(), b_0())
End Sub 展开
extern "C" _declspec (dllexport) int c_Test(float ax[7],float ax_0[7])
在VB中想调用这个函数,之前写了如下代码总是报错,想知道正确的调用方法,希望大神帮
能指点一下,万分感谢。
Private Declare Function c_Test Lib "c:\collision.dll" (ByRef a() As Single, ByRef a_0() As Single) As Long
Private Sub Command1_Click()
Dim b(7) As Single
Dim b_0(7) As Single
For i = 0 To 7
b(i) = 1
b_0(i) = 1
Next i
Label1.Caption = c_Test(b(), b_0())
End Sub 展开
1个回答
展开全部
Private Declare Function c_Test Lib "c:\collision.dll" (ByRef a As Single, ByRef a_0 As Single) As Long
Private Sub Command1_Click()
Dim b(7) As Single
Dim b_0(7) As Single
For i = 0 To 7
b(i) = 1
b_0(i) = 1
Next i
Label1.Caption = c_Test(b(0), b_0(0))
End Sub
Private Sub Command1_Click()
Dim b(7) As Single
Dim b_0(7) As Single
For i = 0 To 7
b(i) = 1
b_0(i) = 1
Next i
Label1.Caption = c_Test(b(0), b_0(0))
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询