VBCEComm.exe Uses the MSCEComm Control in Emulation

ID: Q193235


The information in this article applies to:


SUMMARY

VBCEComm.exe is a sample that illustrates the basics of the MSCEComm control and demonstrates how to access the serial ports through the emulator.


MORE INFORMATION

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

VBCEComm.exe
Release Date: Sep-28-1998

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:
Q119591 How to Obtain Microsoft Support Files from Online Services


WARNING: ANY USE BY YOU OF THE CODE PROVIDED IS AT YOUR OWN RISK. Microsoft provides this code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

VBCECOMM.EXE Readme

What's Required?

  1. If you're using the Windows CE Toolkit for Visual Basic 5.0, this sample requires the updated version of MSCEComm.dll from the Windows CE ActiveX Control Pack available at:

    http://www.microsoft.com/windowsce/downloads/pccompanions/actxconpak1.asp
    This control ships with the Windows CE Toolkit for Visual Basic 6.0.


  2. To allow the MSCEComm control to access the serial ports on the desktop under emulation, the DDK needs to be installed during the Platform SDK installation. To install, run the setup program and use the Custom install option. Select Device Driver Development Kit. This will install the wceemuld device necessary to make the MSCEComm control work in emulation. Restart the computer after the wceemuld device is installed.


  3. The mobile device connection must be disabled after launching the project. This is required due to the fact that the sample program uses the same serial port for communications.


  4. Windows NT 4.0 with Service Pack 3 or later must be installed on the desktop.


Scenarios

The VBCEComm.vbp sample was tested with the following scenarios:

  1. Serial communication between emulation on the desktop and the remote device (connected to the same desktop).


  2. Serial communication between emulation and emulation with the two desktops connected using a null modem cable.


  3. Serial communication between emulation and the desktop running the Visual Basic 5.0 sample serial application (VBTerm.exe). VBTerm.exe is also included in the self-extracting VBCEComm.exe file. The two desktops are connected using a null modem cable.


Step-By-Step Instructions

Scenario 1 (emulation to remote device)

  1. Connect the H/PC device to the desktop.


  2. Open the VBCEComm.vbp project in Visual Basic.


  3. Select VBCEComm Properties from the Project menu and change the Run on Target option to Remote Device.


  4. Press F5 to run the project. A copy of VBCEComm will be running on the remote device.


  5. On the desktop machine running emulation, close the emulation window if it is open. All applications running in emulation must be stopped and all emulation windows and debug windows must be closed in order to start up the wceemuld device.


  6. Click Start, Programs, Microsoft Windows CE Services and then Mobile Devices. On the File menu, clear the Enable Serial Communication check box.


  7. In the Control Panel, double-click Devices.


  8. Select the Serial device driver and click Stop.


  9. Select the wceemuld device driver and click Start.


  10. In the VBCEComm project, Select VBCEComm Properties from the Project menu, and change the Run on Target option to Emulator.


  11. Press the F5 key to run the project in emulation.


  12. Click COMM Start on both ends. Leave the default settings unchanged and click OK. If you want to change the settings, make sure the settings on both ends match.


  13. Type in some text in the Write (Outgoing) Text box and click Send Text on one end. The text should appear in the Read (Incoming) Text box on the other end.

    NOTE: The desktop system may need to be shut down, powered off and then turned back on in order for the text to be successfully sent. This will require steps 7-9 to be repeated.


Scenario 2 (emulation to emulation)

  1. Click Start, Programs, Microsoft Windows CE Services and then Mobile Devices. On the File menu, clear the Enable Serial Communication check box.


  2. In the Control Panel, double-click Devices.


  3. Select the Serial device driver and click Stop.


  4. Select the wceemuld device driver and click Start.


  5. Use a null modem cable to connect the two desktop machines.


  6. Open VBCEComm.vbp with the toolkit on both desktops.


  7. In the VBCEComm project, select VBCEComm Properties from the Project menu and change the Run on Target option to Emulator.


  8. On both desktops, press the F5 key to run the project in emulation.


  9. Click COMM Start on both ends. Leave the default settings unchanged and click OK. If you want to change the settings, make sure the settings on both ends match.


  10. Type in some text in the Write (Outgoing) Text box and click Send Text on one end. The text should appear in the Read (Incoming) Text box on the other end.

    NOTE: The desktop systems may need to be shut down, powered off and then turned back on in order for the text to be successfully sent. This will require steps 2-4 to be repeated.


Scenario 3 (emulation to VBTerm application)

  1. Click Start, Programs, Microsoft Windows CE Services and then Mobile Devices. On the File menu, clear the Enable Serial Communication check box.


  2. In the Control Panel, double-click Devices.


  3. Select the Serial device driver and click Stop.


  4. Select the wceemuld device driver and click Start.


  5. Use a null modem cable to connect the two desktop machines.


  6. Open VBCEComm.vbp with the toolkit on one desktop.


  7. In the VBCEComm project, select VBCEComm Properties from the Project menu and change the Run on Target option to Emulator.


  8. Press the F5 key to run the project in emulation.


  9. Run VBTerm.exe on the other desktop.


  10. In the VBTerm application, select Open Port from the CommPort menu.


  11. In the VBCEComm project, click COMM Start. Leave the default settings unchanged and click OK.


  12. Type in some text in the Write (Outgoing) Text box and click Send Text on one end. The text should appear in the VBTerm application running on the other end.


Troubleshooting Tips

  1. If the following error message appears when running on either emulation or on the remote device:
    Unable to Load Startup Form
    Select Control Manager from the Windows CE menu in the Visual Basic design environment and ensure that the MSCEComm control is registered for use in each.

    For additional information, please see the following article(s) in the Microsoft Knowledge Base:
    Q185204 HOWTO: Use the Control Manager in CE Toolkit for Visual Basic


  2. The DTREnable property of the MSCEComm control must be set to TRUE.


  3. If communication fails, shut down the desktop computer and turn off the power. Wait for a few seconds and turn it back on again.


  4. If wceemuld device fails to start, check to see if the emulation window is closed already. If not, close the emulator, restart the computer and start the wceemuld device again after stopping the serial device, which starts up automatically by default.


  5. If the serial device fails to stop, check to see if the mobile device connection is disabled. The machine may need to be rebooted in order to be able to stop the serial device again.


Additional query words: wince vbce vbce5 vbce6


Keywords          : kbfile kbsample kbAddIn kbToolkit kbVBp500 kbVBp600 kbWinCE kbWinCE100 kbGrpVB 
Version           : WINDOWS:1.0
Platform          : WINDOWS 
Issue type        : kbhowto 

Last Reviewed: May 27, 1999