BUG: eVB:MSCEComm:Unable to Get a Dialtone Using Built-in Modem (266215)



The information in this article applies to:

  • Microsoft eMbedded Visual Basic 3.0

This article was previously published under Q266215

SYMPTOMS

If you have an eMbedded Visual Basic 3.0 application that uses the MSCEComm control to dial out and the modem is built into the device, you may be unable to get a dialtone and dial out.

CAUSE

The reason is that the MSCECOMM control waits to receive a EV_TXEMPTY signal when the output buffer reaches 0. The control uses this signal to ensure that it does not cause an outbuffer overflow, which would cause data loss. Some of the drivers used with the built-in modems do not send this signal.

RESOLUTION

To workaround this problem, add the following code in the code window of Form1, for the sample created under Steps to Reproduce Behavior:
Declare Function WriteFile Lib "Coredll" _
    (ByVal hFile As Long, ByVal lpBuffer As String, _
    ByVal nNumberOfBytesToWrite As Long, _
    lpNumberOfBytesWritten As Long, _
    ByVal lpOverlapped As Long) As Long

Public Sub SendData(ByVal hCommID As Long, sData As String)
    Dim lRet, i, iWrite
    For i = 1 To Len(sData)
        lRet = WriteFile(hCommID, ChrB(Asc(Mid(sData, i, 1))), 1, iWrite, 0)
    Next
End Sub
				
Next replace the Command1_Click event code with the following:
Private Sub Command1_Click()
    SendData Comm1.CommID, "ATDT" & vbCrLf
End Sub
				
Now run the project on the device and click on the CommandButton. You should now hear a dialtone.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION


Steps to Reproduce Behavior

  1. Start a new Windows CE HPC PRO Project. Form1 is created by default.
  2. On the Project menu, click to select Components. Select Microsoft CE Comm Control 3.0 and click OK.
  3. Add a CommandButton and a Comm control to Form1.
  4. Paste the following code into Form1:
    Option Explicit
    
    Private Sub Command1_Click()
        Comm1.Output = "ATDT" & vbCrLf
    End Sub
    
    Private Sub Form_Load()
        Comm1.Handshaking = comRTS
        Comm1.RThreshold = 1
        Comm1.CommPort = 6
        Comm1.PortOpen = True
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
        If Comm1.PortOpen Then Comm1.PortOpen = False
    End Sub
    						
    To determine which Comm port the modem is using use the Remote Registry Editor to look at the HKEY_LOCAL_MACHINE\ExtModems key. You will want to make sure that you use the "built-in" modem.
  5. Run the application on the device and click on the CommandButton. You would expect to hear a dialtone.

Modification Type:MajorLast Reviewed:9/4/2002
Keywords:kbbug kbDSupport KB266215