I'm french and I need some help to use callbackIr an learnIr functions
My project have 2 forms
Form1 with a button learn
Form2 with 2 progressbar pbProgress and pbQuality
- Code: Select all
Private Sub bForm2Learn_Click()
Dim res As Boolean
b_abort = False
res = UUIRTLearnIR(hdle, UUIRTDRV_IRFMT_PRONTO, VarPtr(szLearnBuffer(0)), AddressOf IRLearnCallback, 0, b_abort, 0, 0, 0)
Form2.Show modal, Me
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
- Code: Select all
Public Sub IRReceiveCallback(ByVal IRCode As Long, ByVal userData As Long)
Dim str As String
Form1.lbReceive.Caption = "------"
str = CStr(IRCode)
Form1.lbReceive.Caption = str
End Sub
Public Sub IRLearnCallback(ByVal progress As Long, ByVal sigQuality As Long, ByVal carrierFreq As Long, ByVal userData As Form)
Form2.pbProgress = progress
Form2.pbQuality = sigQuality
End Sub
When IRReceiveCallback is call, lbReceive caption is only refresh on time
And when I click on my learn button the app crash
@++