Bonjour,
J'ai un usbuirt mais je n'arrive pas à utiliser les fonctions de reception de code infrarouge UUIRTLearnIR & UUIRTSetReceiveCallback
Voilà la notice de l'api
http://ccnicolas.free.fr/domotique/apiuirt.htm
J'ai compris qu'il faut une procédure globale qui est appelée à chaque fois que l'appareil detecte de l'infrarouge
Public Sub IRReceiveCallback(ByVal IRCode As Long, ByVal userData As Long)
Dim str As String
str = CStr(IRCode)
Form1.lbReceive.Caption = str
End Sub
Private Sub Form_Load()
Dim var2 As Long
hdle = UUIRTOpen
var2 = UUIRTSetReceiveCallback(hdle, AddressOf IRReceiveCallback , Me)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim var As Long
var = UUIRTClose(hdle)
End Sub
Donc quand je reçoit un code IRReceiveCallback est bien appelé mais j'ai toujours la meme valeur dans IRCode si l'appareil reçoit un autre code infrarouge
Voilà l'exemple fourni mais là je suis un peu largué
' RECEIVE callback funtion. The USB-UIRT API will call this function whenever an
' IR code is received during normal operation. This callback was 'registered'
' via a call to UUIRTSetReceiveCallback
' Note since this callback is called in the context of a separate thread, it is *not*
' running in the context of the main VB forms. Because of this, we must take care of
' updates we make to the main VB dialog. In this example, we post a message to the hidden
' window we created so that the message can be processed in the main VB thread
Public Sub IRReceiveCallback(ByVal IRCode As Long, ByVal userData As Long)
Call PostMessageA(gHiddenWindow, WM_GOT_RECEIVE, 0, IRCode)
End Sub