Hello at all
I have a DLL made in another language who return a string by his pointer in UTF16
I search to read it, is it possible ?
For the moment, i use this code when my DLL is compiling for return UTF8 pointer, and that works very well
but with them, i have just the first character who return in VB6, when my DLL is compiling for return UTF16
Have a good day
I have a DLL made in another language who return a string by his pointer in UTF16
I search to read it, is it possible ?
For the moment, i use this code when my DLL is compiling for return UTF8 pointer, and that works very well
Code:
Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Private Declare Function Try Lib "MyDll.dll" () As Long
Private Declare Function lstrcpy Lib "kernel32" (ByVal lpString1 As Any, ByVal lpString1 As Any) As Long
Private Declare Function lstrlenW Lib "kernel32.dll" (ByVal lpString As Any) As Long
Private Sub Form_Load()
ChDir App.Path
HwndSimulTGC = LoadLibrary("D:\MyDll.dll")
Dim PointerDll As Long, StringDll As String
PointerDll = Try()
StringDll = Space$(lstrlenW(PointerDll))
lstrcpy StringDll, PointerDll
Debug.Print StringDll
FreeLibrary HwndSimulTGC
End Sub
Have a good day