Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1529

Read UTF16 pointer from a standard DLL not activeX

$
0
0
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
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

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

Viewing all articles
Browse latest Browse all 1529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>