求VC写的DLL在VB中调用的写法
vc的dll是这样写的:
_declspec (dllexport) bool _stdcall hConvert(char *s,unsigned char buf[32])
其中*s要求输入一个汉字,buf[32]返回32位的字节
求:vb中应该怎样调用这个dll? 及调用时的写法.
我写成Private Declare Function hConvert Lib "c:\dlldz.dll " (ByRef s() As Byte, ByRef buf() As Byte) As Boolean
[解决办法]
declare function hconvert lib "c:\dlldz.dll " (byval str as string, byval addr as long) as boolean
dim b(32) as byte
dim baddr as long
call hconvert( "啊 ",baddr)
copymemory varptr(b(0)),baddr,32