T
Thomas
Hi group!
I've a problem calling a function in a unmanaged DLL.
Here is the definition of the function I want to use, as it is written
in the documentation :
char Identify(char * ID)
ID : points to a buffer that receives the string. The buffer must have
sufficient space for the string and a terminating null character.
Here is my code in VB.NET to declare the function :
<DllImport("DllToUse.dll", CharSet:=CharSet.Unicode)> _
Private Shared Function IdentifyReader(ByVal Identity As
StringBuilder)As Integer
End Function
Here is my code in VB.NET to call the function :
Dim IDReader As New StringBuilder(255)
Dim res As Integer
res = Identify(IDReader)
IdentifierLecteur = IDReader.ToString()
My problem is that IDReader only contains "white squares" (ASCII
Code=63 ?). I have no error message but the encoding of the string
seems to be incorrect.
Thank you for your help !
Thomas
I've a problem calling a function in a unmanaged DLL.
Here is the definition of the function I want to use, as it is written
in the documentation :
char Identify(char * ID)
ID : points to a buffer that receives the string. The buffer must have
sufficient space for the string and a terminating null character.
Here is my code in VB.NET to declare the function :
<DllImport("DllToUse.dll", CharSet:=CharSet.Unicode)> _
Private Shared Function IdentifyReader(ByVal Identity As
StringBuilder)As Integer
End Function
Here is my code in VB.NET to call the function :
Dim IDReader As New StringBuilder(255)
Dim res As Integer
res = Identify(IDReader)
IdentifierLecteur = IDReader.ToString()
My problem is that IDReader only contains "white squares" (ASCII
Code=63 ?). I have no error message but the encoding of the string
seems to be incorrect.
Thank you for your help !
Thomas