HomeQuestions and AnswersArticlesSamplesLibrariesForumsNewsLinks

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

  1. Connect each end of the serial cable to an available serial port (for example, COM1 or COM2).
  2. If a Smartphone device is connected to the workstation, remove the device from its cradle and disconnect the cradle from the workstation.
  3. In the ActiveSync application, on the File menu, click Connection Settings.
  4. 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).

  5. Ensure that the Allow serial cable or infrared connection to this COM port check box is selected.
  6. 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).
  7. Click OK to close the Connection Settings dialog box.
  8. In eMbedded Visual C++, on the Tools menu, click Configure Platform Manager.
  9. In the device list, click Smartphone 2002 Emulator, and then click Properties.
  10. Click Configure (next to the Startup Server drop-down list box).
  11. In the drop-down list box next to Serial Port 1, click COM1
  12. (or the other COM port to which the serial cable is connected).
  13. Click OK to close the Emulation Configuration Settings dialog box.
  14. Click Test.
  15. 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.
  16. 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.

  17. 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.
  18. 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; }
  19. 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

  1. Terminate all applications that use COM ports (e. g. ActiveSync, emulator)
  2. Launch HyperTerminal and create 2 connections: direct to COM1 and direct to COM2
  3. Launch 2 instances of HyperTerminal
  4. 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.
  5. 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.

  © 2002 Smartphone Developer Network | Want to be an author? | Contact Us