How can I use ActiveSync with Smartphone 2002 emulator?
By Yaroslav Goncharov, June 25, 2002.
Note: The step-by-step instruction is based on the beta documentation (Febrary 2002). The release of the Smartphone 2002 SDK documentation (June 2002) does not contain described mistakes.
Question
I have read the article in Smartphone SDK documentation about connecting ActiveSync to emulator with null-modem cable.
However, that does not work for me. How can I get it work?
Answer
There are several points that are not mentioned in the documentation. There are a lot of questions about this technique,
therefore, I have decided to extend the official documentation about this topic. Below the Microsoft documentation is quated with Italic font.
Step-by-step instruction
- Connect each end of the serial cable to an available serial port (for example, COM1 or COM2).
- If a Smartphone device is connected to the workstation, remove the device
from its cradle and disconnect the cradle from the workstation.
- In the ActiveSync application, on the File menu, click Connection Settings.
The first possible problem. You can have a problem with access to the "Connection Settings" dialog if
you have not synchronized with real device before. To solve this problem check Serial Port value
under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Services key in the registry.
Fill it with COM2 (or one of the COM ports to which the serial cable is connected).
- Ensure that the Allow serial cable or infrared connection to this COM port check box is selected.
- Set the COM port in the drop-down list box to COM2 (or one of the COM
ports to which the serial cable is connected).
- Click OK to close the Connection Settings dialog box.
- In eMbedded Visual C++, on the Tools menu, click Configure Platform Manager.
- In the device list, click Smartphone 2002 Emulator, and then click Properties.
- Click Configure (next to the Startup Server drop-down list box).
- In the drop-down list box next to Serial Port 1, click COM1
(or the other COM port to which the serial cable is connected).
- Click OK to close the Emulation Configuration Settings dialog box.
- Click Test.
- When the emulator image is loaded and Platform Manager has completed its
test, press and hold CTRL (equivalent to the Actionbutton on the
device), and click and hold the clock in the upper right of the title bar. When
the shortcut menu appears, click Run.
But Smartphone 2002 does not have the clock in the upper right of the title bar!
This technique works on Pocket PC 2002, but does not work on Smartphone 2002.
After the step number 14 you will find a workaround of this mistake.
Note When the emulator image loads,
ActiveSync may try to connect to it; however, this connection will be
unsuccessful. If a dialog box appears, asking whether to disconnect the port
from ActiveSync or retry, click retry.
- In the Run dialog box, type repllog and then click OK. The
Repllog.exe file is the device-side part of ActiveSync that initiates a
connection to the partner computer.
As it has been mentioned above you cannot do it on Smartphone 2002. However, You
can create a simple program that will run "repllog.exe" on the device side.
Execute this application from eVC instead of step 14.
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPWSTR lpCmdLine,
int CmdShow)
{
CreateProcess(L"repllog.exe", 0, 0, 0, 0, 0, 0, 0, 0, 0);
return 0;
}
- ActiveSync on the desktop side of the development workstation will detect a
client that is trying to connect without an established partnership. This
detection will cause the New Partnership Wizard to be displayed (the same wizard
appears when a new or cold-booted Smartphone 2002 device is connected to a
desktop computer). In this wizard, first choose whether to establish a
partnership or connect as a guest.
If it still does not work
There are several possible connection problems that can be connected with: a null-cable, a port configuration, a port blocking.
Fortunatly, it is easy to diagnose those problems.
To diagnose the connection problems
- Terminate all applications that use COM ports (e. g. ActiveSync, emulator)
- Launch HyperTerminal and create 2 connections: direct to COM1 and direct to COM2
- Launch 2 instances of HyperTerminal
- Connect to COM1 from the first instance; connect to COM2 from the second instance. If it says
Unable to open COM*, it can mean that the port is blocked by another application.
- Type "12345" in the first HyperTerminal instance. You should get "12345" in the second instance.
If you did not get it, check that the both COM ports have the same settings (e. g. speed).
Discuss
Discuss this QA.
Here you can write your comments and read comments of other developers.
|