Hello. I am working with a company that needs me to download information at
9600 baud. They are outputting the information in RS-232 with only 2 lines
being used the transmit and the ground. They are outputting the information
to my program.
I am using MScomm... This is the problem. I cannot get the comEvent 7 to be
triggered. VB lists the EOF as Char 26, when I look at my ASCII chart 26 is
"Substitution". Anyway, I have tried transmitting a file to my program and
had the following characters in it and none will trigger the ComEvent 7:
End of Text (dec 3, Hex 03)
End of Transmit (dec 4, Hex 04)
End trans. block (dec 23, Hex 17)
End of medium (dec 25, Hex 19)
Substitution (dec 26, Hex 1A)
and just Ctrl+Z
None of these will trigger the comevent 7. Do I need to pull in each
character from the buffer 1 at a time to see if it is EOF? Or is it just if
EOF is in the buffer somewhere?
Any help/advice would be helpful. If at all possible please email me at
macs...@internetcds.com
Thank you for any help.
Mac S. Speed
Don't attempt to use the event. Rather, parse receive data to detect it
yourself. For example,
Private Sub MSComm1_OnComm ()
Static Buffer As String
Dim eofPosition As Integer
Buffer = Buffer & MSComm1.Input
eofPosition = InStr(Buffer, Chr$(26))
If eofPosition > 0 Then
Process Left$(Buffer, eofPosition)
'you write the above subroutine)
If Len(Buffer) > eofPosition Then
Buffer = Mid$(Buffer, eofPosition +1)
Else
Buffer = ""
End If
End If
End Sub
For lots more detailed information, you may be interested in my book. It
has lots of working code examples that you might find to be of value. See
below.
--
Richard Grier (Microsoft Developer MVP)
Hard & Software
12962 West Louisiana Avenue
Lakewood, CO 80228
303-986-2179 (voice)
303-986-3143 (fax)
Author of Visual Basic Programmer's Guide to Serial Communications, 2nd
Edition (355 pages).
For information look on my homepage at http://www.hardandsoftware.net.
Use the Books link to order. For faster service contact the publisher at
http://www.mabry.com.
I am working with the MSComm control and my application demands connecting
with a Remote Access Server and then transferring files with FTP.
From command line it is working fine but from the application using MSComm
Control , I am unable to do it. At the RAS server end it says LineCondition:
Initializing Modem
and then times out.(The phone rings at the server end, connected in parallel
to check)The MScomm should return ok which it fails although the phone rings
, I have tried the Dialer.Vbp example provided by the MSDN but that also
gives the same problem.
AS per my analysis it is looking for the user name and password at the
server end as the RAS server will have some valid accouts which can access
its resources.
Is there any way of attaching a phone book entry for authentication at the
server end or sending the user name and password explicitly by the MScomm
control.
Please let me know , and if you analyse the problem in some other way , mail
me the answer.It is very urgent for me.
Thanks
Manu Sharma
Plaese mail a copy to
mailto: manu....@sisl.co.in
"Manu Sharma" <manu....@sisl.co.in> wrote in message
news:87r91l$f4q$1...@papyrus.erlm.siemens.de...
See my email on this subject. You cannot use MSComm for FTP. You should
use the RAS API (or a control that implements RAS dialing), and the FTP
control, or any one of several free, shareware, or commercial add-ons that
are available.