VBCEComm.exe Uses the MSCEComm Control in Emulation
ID: Q193235
|
The information in this article applies to:
-
Microsoft Windows CE Toolkit for Visual Basic 6.0, version 1.0
-
Microsoft Windows CE Toolkit for Visual Basic 5.0, version 1.0
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?
- 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.
- 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.
- 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.
- 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:
- Serial communication between emulation on the desktop and the remote
device (connected to the same desktop).
- Serial communication between emulation and emulation with the two
desktops connected using a null modem cable.
- 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)
- Connect the H/PC device to the desktop.
- Open the VBCEComm.vbp project in Visual Basic.
- Select VBCEComm Properties from the Project menu and change the Run on Target option to Remote Device.
- Press F5 to run the project. A copy of VBCEComm will be running on the
remote device.
- 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.
- Click Start, Programs, Microsoft Windows CE Services and then Mobile
Devices. On the File menu, clear the Enable Serial Communication check box.
- In the Control Panel, double-click Devices.
- Select the Serial device driver and click Stop.
- Select the wceemuld device driver and click Start.
- In the VBCEComm project, Select VBCEComm Properties from the Project
menu, and change the Run on Target option to Emulator.
- Press the F5 key to run the project in emulation.
- 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.
- 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)
- Click Start, Programs, Microsoft Windows CE Services and then Mobile
Devices. On the File menu, clear the Enable Serial Communication check box.
- In the Control Panel, double-click Devices.
- Select the Serial device driver and click Stop.
- Select the wceemuld device driver and click Start.
- Use a null modem cable to connect the two desktop machines.
- Open VBCEComm.vbp with the toolkit on both desktops.
- In the VBCEComm project, select VBCEComm Properties from the Project
menu and change the Run on Target option to Emulator.
- On both desktops, press the F5 key to run the project in emulation.
- 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.
- 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)
- Click Start, Programs, Microsoft Windows CE Services and then Mobile
Devices. On the File menu, clear the Enable Serial Communication check box.
- In the Control Panel, double-click Devices.
- Select the Serial device driver and click Stop.
- Select the wceemuld device driver and click Start.
- Use a null modem cable to connect the two desktop machines.
- Open VBCEComm.vbp with the toolkit on one desktop.
- In the VBCEComm project, select VBCEComm Properties from the Project
menu and change the Run on Target option to Emulator.
- Press the F5 key to run the project in emulation.
- Run VBTerm.exe on the other desktop.
- In the VBTerm application, select Open Port from the CommPort menu.
- In the VBCEComm project, click COMM Start. Leave the
default settings unchanged and click OK.
- 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
- 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
- The DTREnable property of the MSCEComm control must be set to TRUE.
- If communication fails, shut down the desktop computer and turn
off the power. Wait for a few seconds and turn it back on again.
- 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.
- 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