Delphi动态库相关代码:
.......
procedure ArrayTest(var aa:Array of byte);stdcall;
.......
procedure ArrayTest(var aa:Array of byte);stdcall;
begin
//代码
end;VB应用相关代码:
//我用的第一种调用方法。
Private Declare Sub ArrayTest Lib "..\Project1.dll" (aa() As Byte)Private Sub Command1_Click()
.......
Dim rr() As Byte
.......
Call ArrayTest(rr)
End Sub在vb应用程序中调用delphi动态库,执行Command1_Click提示“Bad Dll calling convention”错误,点结素后提示“该内存不能为‘read’”直接弹出了VB运行环境。//我用的第二种调用方法。
Private Declare Sub ArrayTest Lib "..\Project1.dll" (aa() As Byte)Private Sub Command1_Click()
.......
Dim rr() As Byte
.......
Call ArrayTest(rr(0))
End Sub在vb应用程序中调用delphi动态库,执行Command1_Click提示“TYpe mismatch: array or user-defined type expected”错误,点确定后回到运行环境,还是提示相同的错误!
.......
procedure ArrayTest(var aa:Array of byte);stdcall;
.......
procedure ArrayTest(var aa:Array of byte);stdcall;
begin
//代码
end;VB应用相关代码:
//我用的第一种调用方法。
Private Declare Sub ArrayTest Lib "..\Project1.dll" (aa() As Byte)Private Sub Command1_Click()
.......
Dim rr() As Byte
.......
Call ArrayTest(rr)
End Sub在vb应用程序中调用delphi动态库,执行Command1_Click提示“Bad Dll calling convention”错误,点结素后提示“该内存不能为‘read’”直接弹出了VB运行环境。//我用的第二种调用方法。
Private Declare Sub ArrayTest Lib "..\Project1.dll" (aa() As Byte)Private Sub Command1_Click()
.......
Dim rr() As Byte
.......
Call ArrayTest(rr(0))
End Sub在vb应用程序中调用delphi动态库,执行Command1_Click提示“TYpe mismatch: array or user-defined type expected”错误,点确定后回到运行环境,还是提示相同的错误!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货