by vhoang » Fri Jul 08, 2005 2:01 pm
software only.
It starts working again when I shut down the app and start it again.
thinking about adding a button to launch the following code:
I will need to wait a few days for the stop then test the button...
-------------------------------------------------------
res = UUIRTClose(hDrvHandle)
' Obtain a handle to the USB-UIRT via the UUIRTOpen call. If successful, a handle
' is returned which we *must* use in all subsequent APi calls.
hDrvHandle = UUIRTOpen()
' If Open call failed, we will be returned an INVALID_HANDLE_VALUE and need to look
' at the error to determine what went wrong...
If hDrvHandle = INVALID_HANDLE_VALUE Then
If Err.LastDllError = UUIRTDRV_ERR_NO_DLL Then
Call MsgBox("Unable to find USB-UIRT Driver. Please make sure driver is Installed!", vbOKOnly, "ERROR")
ElseIf Err.LastDllError = UUIRTDRV_ERR_NO_DEVICE Then
Call MsgBox("Unable to connect to USB-UIRT device! Please ensure device is connected to the computer!", vbOKOnly, "ERROR")
ElseIf Err.LastDllError = UUIRTDRV_ERR_NO_RESP Then
Call MsgBox("Unable to communicate with USB-UIRT device! Please check connections and try again. If you still have problems, try unplugging and reconnecting your USB-UIRT. If problem persists, contact Technical Support!", vbOKOnly, "ERROR")
ElseIf Err.LastDllError = UUIRTDRV_ERR_VERSION Then
Call MsgBox("Your USB-UIRT's firmware is not compatible with this API DLL. Please verify you are running the latest API DLL and that you're using the latest version of USB-UIRT firmware! If problem persists, contact Technical Support!", vbOKOnly, "ERROR")
Else
Call MsgBox("Unable to initialize USB-UIRT (unknown error)!", vbOKOnly, "ERROR")
End If
End
Else
' If Open was successful, we'll want to register a receive callback function
' for the USB-UIRT API to call each time an IR code is received.
res = UUIRTSetReceiveCallback(hDrvHandle, AddressOf IRReceiveCallback, Me)
End If
-----------------------------------------