关于调用DLL的问题
test.DLL是这样说明的:
function get_sm(AFZ,ADZ:Pchar;AYSLB,APMDM,AJS,AJZ:Integer;Asave : Boolean = False) : integer;
VB是这样写的:
Private Declare Function myTest Lib "test " (ByVal AFZ As String, ByVal ADZ As String, ByVal AYSLB As Integer, ByVal APMDM As Integer, ByVal AJS As Integer, ByVal AJZ As Integer, ByVal Asave As Boolean) As Integer
一运行就报“溢出”,
好像Pchar和String转换上有问题。
[解决办法]
Integer 都改为long
[解决办法]
ByVal AFZ As String, ByVal ADZ As String
声明没错
VB里要从API返回字符串就要这样传指针进去.
我觉得 "溢出 "问题应该出在最后这个返回值上....
它是Integer,如果返回值大于32767,就溢出了...
个人意见......
[解决办法]
Integer 都改为long