Microsoft KB Archive/266215

= BUG: eVB:MSCEComm:Unable to Get a Dialtone Using Built-in Modem =

Article ID: 266215

Article Last Modified on 9/4/2002

-

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 &quot;Coredll&quot; _ (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, &quot;ATDT&quot; & 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.



Steps to Reproduce Behavior
 Start a new Windows CE HPC PRO Project. Form1 is created by default. On the Project menu, click to select Components. Select Microsoft CE Comm Control 3.0 and click OK. Add a CommandButton and a Comm control to Form1.  Paste the following code into Form1: Option Explicit

Private Sub Command1_Click Comm1.Output = &quot;ATDT&quot; & 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 &quot;built-in&quot; modem.  Run the application on the device and click on the CommandButton. You would expect to hear a dialtone.</li></ol>

Additional query words: wvc evb

Keywords: kbbug kbpending KB266215

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.