回复 10楼 xzlxzlxzl
已测试ok,分享一下,整个dll需要注意的是char* 指针类型(传地址还是传值的问题)
方法1(传地址):
private function ReadBasicInfo lib "user.dll"(byval ino as long,
byref respBuf as byte,byref iLength as long) as boolean 'api声明部分
dim ino as long,iLength as long
dim respBuf(1 to 40) as byte
ReadBasicInfo(ino,respbuf(1),ilength)
respbuf(1)获得的地址位置,后续要得到地址对应的值的时候,需要使用
结果=StrConv(Mid(respBuf, 1, iLength / 2), vbUnicode)
方法2(传值):
private function ReadBasicInfo lib "user.dll"(byval ino as long,
byval respBuf as string,byref iLength as long) as boolean 'api声明部分
dim ino as long,iLength as long
dim respBuf as string
ReadBasicInfo(ino,respbuf,ilength)
[此贴子已经被作者于2016-11-2 08:14编辑过]