I need to make a dll work with Xojo… but I am failing…
Here’s the VB6 code the comes with the documentation. I tried and it works… In xojo, the Dll seems to load fine, but I get a connection error…
[code]
Private Declare Function InitIDCard Lib “IDCard.dll” (ByVal lpUserId As String, ByVal nType As Long, ByVal lpDirectory As String) As Long
Private Sub Command1_Click()
If m_bIsInitSuccess = True Then
ResultTextBox.Text = "The recognition engine is loaded successfully."
Exit Sub
End If
Dim nRet As Long
Dim strTmp As String
strTmp = "5317480525913680254"
nRet = InitIDCard(StrConv(strTmp, vbUnicode), 0, StrConv("", vbUnicode))
If nRet = 0 Then
ResultTextBox.Text = "The recognition engine is loaded successfully."
m_bIsInitSuccess = True
Else
ResultTextBox.Text = "Recognition engine loaded failure. Err ." & Str(nRet)
m_bIsInitSuccess = False
End If
End Sub[/code]
Here’s the proposed Xojo Code
[code]Declare Function InitIDCard Lib “IDCard.dll” (ByVal lpUserId As cString, ByVal nType As Integer, ByVal lpDirectory As cString) As integer
If m_bIsInitSuccess = True Then
MsgBox ( “The recognition engine is loaded successfully.”)
Exit Sub
End If
Dim nRet As Integer
Dim strTmp As CString = “5317480525913680254”
nRet = InitIDCard(strTmp, 0, “”)
If nRet = 0 Then
MsgBox ( “The recognition engine is loaded successfully.”)
m_bIsInitSuccess = True
Else
MsgBox ( "Recognition engine loaded failure. Err " + Str(nRet))
m_bIsInitSuccess = False
End If[/code]
Thanks!