Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSComm problems

Status
Not open for further replies.

ZOR

Technical User
Jan 30, 2002
2,963
GB
I have inherited some code which I don't understand, but have to insert it into my database. When I go to compile my code it wont, saying objects not declared and point to comEventBreak . Anyone understand what the problem is, many thanks


Private Sub MSComm1_OnComm()
Static intComBreak As Integer
Dim Text3 As String

inp = MSComm1.Input 'Read machine reply

Select Case MSComm1.CommEvent
' Handle each event or error by placing
' code below each case statement

' Errors


Case comEventBreak ' A Break was received.
Text3 = "comEventBreak"
intComBreak = 1
Case comEventFrame ' Framing Error
Text3 = "comEventFrame"
Case comEventOverrun ' Data Lost.
Text3 = "comEventOverrun"
Case comEventRxOver ' Receive buffer overflow.
Text3 = "comEventRxOverFlow"
Case comEventRxParity ' Parity Error.
Text3 = "comEventParityError"
Case comEventTxFull ' Transmit buffer full.
Text3 = "comEventTxFull"
Case comEventDCB ' Unexpected error retrieving DCB]
Text3 = "comEventDCB"

' Events
Case comEvCD ' Change in the CD line.
Text3 = "comEvCD"
Case comEvCTS ' Change in the CTS line.
Text3 = "comEvCTS"
Case comEvDSR ' Change in the DSR line.
Text3 = "comEvDSR"
Case comEvRing ' Change in the Ring Indicator.
Text3 = "comEvRing"
Case comEvReceive ' Received RThreshold # of chars
Text3 = "comEvReceive"


Case comEvSend ' There are SThreshold number of
Text3 = "comEvSend"
' characters in the transmit
' buffer.
Case comEvEOF ' An EOF charater was found in
Text3 = "comEvEOF"
' the input stream
End Select



End Sub
 
Provided MSCOMM32.OCX is properly registered you may add the reference to Microsoft Comm Control #.0 (menu Tools -> References ...)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks PHV. I have the ocx on my PC now having put VB6 on it. I can choose it from the activex controls list in Access, but cannot find it in Tools/References. So until then I suppose I will have to find a way to register it properley. Somewhere along the way I thought it was now called Microsoft Communication Control (unless that was the original long word for the same thing). I did find a site that had the control on for download, and suggested a registry setting/fix. But I will go down that road only if I have to. Thanks again. Regards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top