Description of functions
AN3954
8/47
Doc ID022016 Rev 4
2
Description of functions
This section describes the various functions required to evaluate the CR95HF
demonstration board.
2.1
Functions to check DLL installation and USB connection
2.1.1 CR95HFDll_GetDLLrev
This function detects if the
CR95HF.dll
file has been installed in the system folder of the host
PC system, reads its header and sends back its revision number.
This is used by software to ensure that the DLL is correctly installed and that it is up to date.
If no DLL file is found, it returns an error message.
Visual Basic language
Declaration
:
Public Declare Function CR95HFDll_GetDLLrev Lib
"CR95HF.dll" (ByVal mystring As String) As Long
Prototype
:
Dim lngStatus As Long
Dim strAnswer As String * 256
lngStatus = CR95HFDll_GetDLLrev(strAnswer)
Input parameter
:
None
Output parameter
:
strAnswer: Revision of the DLL installed on your PC system.
Answer example: "0.4"
Returned value
: lngStatus:
0
Source code example
Private Sub cmdGetDllRev_Click()
Dim strAnswer As String * 256
Dim lngStatus As Long
lngStatus = CR95HFDll_GetDLLrev(strAnswer)
If (lngStatus = 0) Then
txtDllRev.Text = strAnswer
Else
txtDllRev.Text = "Error = no Dll found"
End If
End Sub