|
-
Jun 1st, 2000, 11:51 PM
#1
Thread Starter
Junior Member
Hi,
i have been playing with the MScomm control and i have been able to get it to pass data back and forth. But i am not able to get it to process data as it recieves it. let me explain. i built a chat app with two richtext boxes. one for typing your text and one for viewing what the other computer sent. i would like to be able to type a character into the input box and have it be displayed on the remote computer right away. right now, i have to generate an OnComm event to be able to flush the buffer. i tried setting the inbuffersize to 1 and just about everything else i can think of. but i still have to push a button to generate an oncomm event and flush the recieve buffer.
please tell me if i have to live with it, or is there something i can do?
Shaba
-
Jun 2nd, 2000, 12:16 AM
#2
Hyperactive Member
What you can do is sit in a loop
Code:
Dim arr() As Byte
Do
DoEvents
If (frm.MSComm.InBufferCount > 1) Then
arr = frm.MSComm.Input
'' convert the array to a string
'' append the string to a display box
End If
Loop Until False '' or some other condition
Now all you need to do is handle the sends, which can be done in the KeyPress event
-
Jun 2nd, 2000, 02:42 AM
#3
Addicted Member
Hi,
set your mscomm control to this :
inbufsiz 1024
sendbufsize 1024
rtresh : 1
do not click any option or handshake
0 in all the rest.
Oncomm()
display = display & com.input
end Oncomm
PS do not use Doevents in the Oncomm even because
your oncomm will be cutted by some other oncomm
events and the caracters may be misplaced from then
order you sent it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|