[an error occurred while processing this directive] [an error occurred while processing this directive]
Ответ: можно посмотреть здесь, может поможет..
(«Телесистемы»: Конференция «Микроконтроллеры и их применение»)
[an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive]

Отправлено AlexS 18 декабря 2001 г. 11:37
В ответ на: Вопрос про IrDA отправлено VR 18 декабря 2001 г. 10:48

http://chat.vbce.com:8080

Topic: Re: VB, VBCE and InfraRed (2 of 2), Read 540 times
Conf: Tips and Tricks
From: Deleted User
Date: Monday, June 21, 1999 03:06 PM

I have changed your program a little to make it easier to understand. It is now one textbox for receive and and for transmit and a commanbutton for send. Also the comm.control.
Set DTR and RTS high as your IrDA probably is powered from these pin. Start with 96000,N,8,1 as the IrDA pobably will work without any IrDA driver with these setting, Also Rthreshold should be 1 and Strheshold shoudl be 0.

Your problem is that you cannot handle the textbox control the way you are doing it in the comm event.
Here is the code:

Option Explicit
Private Sub Received(dta)
Dim TextEOT
TextEOT = Len(txtReceived.Text)
txtReceived.SelStart = TextEOT
txtReceived.SelText = dta
End Sub
Private Sub cmdSend_Click()
Comm1.Output = txtToSend.Text
End Sub
Private Sub Comm1_OnComm()
If Comm1.CommEvent = 2 Then Call Received(Comm1.Input)
End Sub
Private Sub Form_Load()
If Not Comm1.PortOpen Then Comm1.PortOpen = True
End Sub

Regards,
Gunnar


Составить ответ  |||  Конференция  |||  Архив

Ответы



Перейти к списку ответов  |||  Конференция  |||  Архив  |||  Главная страница  |||  Содержание  |||  Без кадра

E-mail: info@telesys.ru