'This is the code for using irdll in Visual Basic 4.0 Profession Edition 'You must only use the 16-bit development system, the 32-bit system 'will crash. ' 'Provided by Tim Dillen, February 1997, coldwellbank@citcom.net - attn:Tim _____________________________________________________ Place in module1, General - Declarations: _____________________________________________________ Declare Function IRSetPort Lib "irdll.dll" (ByVal pport As Integer) As Boolean Declare Function IRRecord Lib "irdll.dll" (ByVal Rbuffer As String, ByRef IRLen2 As Integer) As Boolean Declare Function IRPlay Lib "irdll.dll" (ByVal Pbuffer As String, ByVal IRLen As Integer) As Boolean _____________________________________________________ Place in procedures in module1: _____________________________________________________ Public Sub PlayIR(IRFile As String) Dim IRRec As String Dim ans As Boolean Open "c:\vb\" & IRFile For Binary As #1 Input #1, IRRec Close #1 'can not get any more because vb integer max is 32700 If Len(IRRec) > 32700 Then IRRec = Left(IRRec, 32700) End If ans = IRPlay(IRRec, Len(IRRec)) End Sub _____________________________________________________ Public Sub RecordIR() Dim IRLen As Integer 'you have to have a big string or it will overflow in dll Dim IRRec As String * 50000 Dim IRRec2 As String Dim ans As Boolean Dim message As String Dim title As String Dim myvalue As String IRLen = 32700 IRRec = "" ans = IRRecord(IRRec, IRLen) IRRec2 = Left(IRRec, IRLen) message = "Enter Filename for IR Signal" ' Set prompt. title = "Save IR Signal" myvalue = InputBox(message, title, "") Open "c:\vb\" & myvalue For Binary Access Write As #1 Put #1, , IRRec2 Close #1 End Sub _____________________________________________________ Public Sub PortIRSet(PortNum as integer) Dim ans As Boolean ans = IRSetPort(PortNum) End Sub _____________________________________________________ Call procedures this way: _____________________________________________________ Module1.PlayIR ("tvon") Module1.RecordIR Module1.PortIRSet(1)