×

Discussion Board

Results 1 to 4 of 4

Thread: MSCOMM AND USB

  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    8

    MSCOMM AND USB

    HEY GUYS,
    I WANTED TO KNOW THAT DOES MSCOMM CONTROL IN VB6 SUPPORT USB....
    BECAUSE I TRIED TO WRITE A PROGRAM OF SENDING SMS IN VB AND WHENEVER I RUN IT , IT GIVES ME THIS ERROR ERROR:8020 ERROR READING FROM COMM PORT DEVICE....
    I SEARCH MICROSOFT TOO AND IT GAVE ME THIS RESULT


    "The MSComm control is implemented in the MSComm32.ocx file. The MSComm control permits you to provide serial communications that transmit data and that receive data by using a serial port for an application. You can use the MSComm control to provide serial communications that use a communications (COM) port. A COM port is a serial port. However, you cannot use the MSComm control to provide serial communications that use a USB port. A USB port is not a serial port. A USB port is a bus. Therefore, by design, you cannot use the MSComm control to access a USB port.

    A USB port is a bus that is designed to provide Plug and Play functionality for some peripheral devices. A USB port behaves more like an integrated device electronics (IDE) controller than like an ordinary serial port. Therefore, you cannot access a USB device if you are in user mode. To access a USB device, use an appropriate device driver that can access the USB device in kernel mode. Some USB devices include device drivers that handle this type of communication.

    Note You cannot use the MSComm control to access a USB serial adapter that is connected to a USB port. If you try to use the MSComm control to access a USB port, you may receive the following error message:"

    from http://support.microsoft.com/default.aspx/kb/832678


    DO YOU KNOW HOW TO SOLVE IT PLZ HELP.............

  2. #2
    Registered User
    Join Date
    Mar 2007
    Posts
    8

    Re: MSCOMM AND USB

    MY CODE FOR MSCOMM1_ONCOMM() EVENT IS

    HTML Code:
    Private Sub MSComm1_OnComm()
        Dim strMessage As String
        Select Case MSComm1.CommEvent
            ' Event messages.
            Case comEvReceive
               If MSComm1.InBufferCount > 0 Then
                 strMessage = StrConv(MSComm1.Input, vbUnicode)  ' ERROR IN THIS LINE (MSCOMM1.INPUT) "ERROR READING FROM COMM PORT DEVICE"
                 Text1.Text = strMessage
               Else
                MsgBox ("No message received")
              End If
    '        Case comEvSend
    '        Case comEvCTS
    '            strMessage = "[Change in CTS Detected]"
    '        Case comEvDSR
    '            strMessage = "[Change in DSR Detected]"
    '        Case comEvCD
    '            strMessage = "[Change in CD Detected]"
    '        Case comEvRing
    '            strMessage = "[The Phone is Ringing]"
    '        Case comEvEOF
    '            strMessage = "[End of File Detected]"
                
            ' Error messages.
            Case comBreak
                strMessage = "[Break Received]"
            Case comCDTO
                strMessage = "[Carrier Detect Timeout]"
            Case comCTSTO
                strMessage = "[CTS Timeout]"
            Case comDCB
                strMessage = "[Error retrieving DCB]"
            Case comDSRTO
                strMessage = "[DSR Timeout]"
            Case comFrame
                strMessage = "[Framing Error]"
            Case comOverrun
                strMessage = "[Overrun Error]"
            Case comRxOver
                strMessage = "[Receive Buffer Overflow]"
            Case comRxParity
                strMessage = "[Parity Error]"
            Case comTxFull
                strMessage = "[Transmit Buffer Full]"
    '        Case Else
    '            strMessage = "[Unknown error or event: " & MSComm1.CommEvent & "]"
        End Select
        strBuffer = strBuffer & strMessage
    End Sub

  3. #3
    Registered User
    Join Date
    Oct 2007
    Posts
    4

    Re: MSCOMM AND USB

    Hello, I have the same problem.

    Did you solve the problem receiving data?

    Help me please

  4. #4
    Registered User
    Join Date
    Jan 2008
    Posts
    1

    Re: MSCOMM AND USB

    MSCOMM does not directly support USB, but Nokia and others write drivers to make their USB devices appear as serial devices to windows.

    As this is a Nokia forum - I am assuming that the problem relates to a Nokia mobile phone.

    From personal experience only - this may not apply to everyone..
    Whenever I have received this error, it has been because the port that my phone is using is already configured for another device.
    In my case, it has been a mobile on COM4 (6230 on USB data cable).
    The port opens OK, but when I try to do anything with it, I was getting error 8020 (error reading from = unable to do anything with the device).

    Firstly - check that you have installed the correct drivers for both your phone and cable!!

    Certain phone/cable combinations assign the phone to COM4. In every copy of windows I have used, this is also usually assigned to the Infrared serial device. The COM port opens OK, but trying to read or write to it causes an error.

    Changing the phone to another port does not always work - the Nokia driver re-assigns the phone to COM4 on the next reboot.

    It is much easier to simply disable the infrared in the BIOS, or move the infrared to a free COM port using the control panel.

    It sorted my problems out, but it took an entire day to figure it out - as the infrared port does not show up on the Control Panel's modems applet.

    Might be worth checking.

    I've had 5x USB Bluetooth mobiles, 1x USB mobile, 2x PCI 56K modems all running at the same time, logging calls and sending SMS text messages using the VB6 MSCOMM control - so I know it can be done.

    Hope this helps some of you.

Similar Threads

  1. MSComm problems
    By Ove Svensson in forum PC Suite API and PC Connectivity SDK
    Replies: 3
    Last Post: 2005-02-22, 02:09
  2. accessing the 8310 modem thru USB InfraRed connection
    By Gwr in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 1970-01-01, 02:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×