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
(http://support.microsoft.com/kb/119591/EN-US/
)
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.
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.
To allow the MSCEComm control to access the serial ports on
the desktop under emulation, the DDK needs to be installed during the Handheld
PC 2.0 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 2000 or 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 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.
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 computer 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, point to Programs, point to Microsoft Windows CE Services, and
then click 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 then click Stop.
Select the wceemuld device driver, and then click Start.
In the VBCEComm project, select VBCEComm Properties from the Project menu, and then change the Run on Target option to Emulator.
Press F5 to run the project in emulation.
Click COMM Start on both ends. Leave the default settings unchanged, and then 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 then 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, point to Programs, point to Microsoft Windows CE Services, and
then click 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 then click Stop.
Select the wceemuld device driver, and then click Start.
Use a null modem cable to connect the two desktop
copmuters.
Open VBCEComm.vbp with the toolkit on both
desktops.
In the VBCEComm project, select VBCEComm Properties from the Project menu, and then change the Run on Target option to Emulator.
On both desktops, press F5 to run the project in
emulation.
Click COMM Start on both ends. Leave the default settings unchanged, and then 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 then 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, point to Programs, point to Microsoft Windows CE Services, and
then click 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 then click Stop.
Select the wceemuld device driver, and then click Start.
Use a null modem cable to connect the two desktop
computers.
Open VBCEComm.vbp with the toolkit on one
desktop.
In the VBCEComm project, select VBCEComm Properties from the Project menu, and then change the Run on Target option to Emulator.
Press F5 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 then click OK.
Type in some text in the Write (Outgoing) text box, and then click Send Text on one end. The text should appear in the VBTerm application running on the
other end.
If the following error message appears when running on
either emulation or on the remote device:
Unable to Load
Startup Form
Select Control Manager fromthe
Windows CE menu in the Visual Basic design environment and ensure that the
MSCEComm control is registered for use in each.
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.