Microsoft KB Archive/112418

From BetaArchive Wiki

Article ID: 112418

Article Last Modified on 8/5/2004



APPLIES TO

  • Microsoft Visual Basic 3.0 Professional Edition



This article was previously published under Q112418

SYMPTOMS

The MSCOMM.VBX custom control 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 Windows for Workgroups 3.11. This is not a problem with the MSCOMM control since it can be reproduced by calling the CloseComm Windows API function directly.

WORKAROUND

The following file is available for download from the Microsoft Download Center:

Release Date: May 31, 2000

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services


Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

STATUS

Microsoft has confirmed this to be a problem 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

  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 (Comm1) control and a command button (Command1) to Form1.
  4. Add the following code to the Command1 Click event procedure:

       Sub Command1_Click ()
          comm1.PortOpen = True
          comm1.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.



Additional query words: 3.00 serial comm port

Keywords: kbdownload kbcode KB112418