Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, ByVal Source As Long, ByVal Length As Long) '定义调用DLL【RtlMoveMemory内存复制】【公有变量】
Public Declare Function 回调数据 Lib "C:\Users\Administrator\Desktop\第三十集-ExcelVBA调用易语言DLL相互通信\test.dll" (ByRef Hwnd As Long) As Long'定义易语言DLL【公有变量】
Public Sub 易语言()
Dim wbnr As String '文本内容
Dim sjdz As Long '数据地址
Dim sjcd As Long '数据长度
Dim qncsj() As Byte '取内存数据
sjdz = 回调数据(sjcd)
fi sjcd <> Then
ReDim qncsj(sjcd - 1)
CopyMemory qncsj(0), sjdz, sjcd
wbnr = StrConv(qncsj, vbUnicode) 'VBA字符串转换——StrConv 函数 Unicode编码
Range("A1").Value = wbnr
End If