BUG: Serial Port Driver for WFW 3.11 Sends Extra Byte

Last reviewed: February 5, 1997
Article ID: Q147653
The information in this article applies to:
  • Professional and Enterprise Editions of the Microsoft Visual Basic for Windows, 16-bit only, version 4.0

SYMPTOMS

The Mscomm.vbx or Mscomm16.ocx custom controls may appear to send an unexpected byte when the port is closed by setting the PortOpen property to false.

CAUSE

There is a known problem with the miniport driver SERIAL.386 that was released with Microsoft Windows for Workgroups 3.11. This is not a problem with the MSCOMM control because it can be reproduced by calling the CloseComm Windows API function directly.

WORKAROUND

The following file is available for download from the Microsoft Software Library:

 ~ Wg1001.exe (size: 23600 bytes) 

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from
               Online Services

STATUS

Microsoft has confirmed this to be an issue in Windows for Workgroups version 3.11. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem in the 16-Bit Edition of Visual Basic 4

  1. Connect two machines using a null modem cable. You must run Windows for Workgroups 3.11 on the machine running Visual Basic.

  2. Start a new project in Visual Basic, Form1 is created by default.

  3. Add an MSCOMM (MsComm1) control and a command button (Command1) to Form1.

  4. Add the following code to the Command1 Click event procedure:

       Sub Command1_Click ()
          Mscomm1.PortOpen = True '(Default name of control has changed in VB4)
          Mscomm1.PortOpen = False
       End Sub
    
    

  5. Start the Terminal application on the second machine. In Terminal, choose Settings Communications (ALT, S, C) and change the Baud Rate to 9600.

  6. From the Run menu in Visual Basic on the first machine, choose Start (ALT, R, S) or press the F5 key to run the program. Click the Command1 button and the machine running Terminal will indicate that a byte has been transmitted from closing the port.

The problem can also be reproduced with the following method:

  1. Connect two machines using a null modem cable. You must run Windows for Workgroups 3.11 on the machine running Visual Basic.

  2. Start a new project in Visual Basic. Form1 is created by default.

  3. Add a command button (Command1) to Form1.

  4. Add the following Declare statements to the General declarations section of Form1:

       ' Enter each of the following Declare statements on one, single line:
       Declare Function OpenComm Lib "User" (ByVal lpComName As String, ByVal
          wInQueue As Integer, ByVal wOutQueue As Integer) As Integer
       Declare Function CloseComm Lib "User" (ByVal nCid As Integer)
          As Integer
    
    

  5. Add the following code to the Command1 Click event procedure:

       Sub Command1_Click ()
          Dim id As Integer, success As Integer
          id = OpenComm("COM1", 1024, 128)
          success = CloseComm(id)
       End Sub
    
    

  6. Start the Terminal application on the second machine. In Terminal, choose Settings Communications (ALT, S, C) and change the Baud Rate to 9600.

  7. From the Run menu in Visual Basic on the first machine, choose Start (ALT, R, S) or press the F5 key to run the program. Click the Command1 button and the machine running Terminal will indicate that a byte has been transmitted from closing the port.


KBCategory: kbprg kbcode kbbuglist kbfile
KBSubcategory: PrgCtrlsCus vb4win vb416
Additional reference words: serial comm port 4.00


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 5, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.