Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
4/8/2010

This code sample is named TransportDemo. It demonstrates how to create a custom messaging transport application for Windows Mobile Professional and Windows Mobile Classic.

Feature Area

Relevant APIs

Usage

To run the code sample
  1. Navigate to the solution file (*.sln), and double-click it. By default, the solution file is copied to the following folder:

    C:\Program Files\Windows Mobile 6.5.3 DTK\Samples\PocketPC\CPP\win32\TransportDemo

    Microsoft Visual Studio launches and loads the solution.

  2. Build the solution (Ctrl+Shift+B).

  3. Deploy the solution (F5).

To install the transport using a CAB
  1. Copy the installation CAB to the My Documentsfolder in the Windows Mobile Emulator. You will need to use the Remote File Viewer tool that can be found in the Visual Studio Start Menu..

  2. In the emulator, click Start> Programs> File Explorer> My Documents> TransportDemoSetup.cab. Wait for the installation to complete.

  3. Start the Messaging application ( Start> Messaging).

  4. Create a new account ( Menu> Tools> New Account).

  5. Enter an e-mail address that uses the custom transport.

  6. Click Next.

  7. Click Next.

  8. Enter the username and password for the email account using the custom transport.

  9. Click Next.

  10. Select the Custom Transport from the Account Typedrop down.

  11. Complete the remainder of the e-mail setup according to the custom transport messaging account settings.

To manually install the transport (without using a CAB)
  1. Copy the transport DLL to the \Windowsdirectory on the mobile device or in the emulator.

  2. Set these registry keys using the Remote Registry Editor tool that can be found in the Visual Studio Start Menu.. Note that the key name "TransportDemo" must match the value for "Name" here.

    Copy Code
    [HKEY_LOCAL_MACHINE\Software\Microsoft\Inbox\Svc\]
    "Name"=""
    "DLL"="TransportDemo.dll"
    "Port"=dword:00000000
    
  3. Start the messaging application ( Start> Messaging).

  4. Create a new account ( Menu> Tools> New Account).

  5. Enter an e-mail address that uses the custom transport.

  6. Click Next.

  7. Click Next.

  8. Enter the username and password for the email account using the custom transport.

  9. Click Next.

  10. Select the Custom Transport from the Account Typedrop down.

  11. Complete the remainder of the e-mail setup according to the custom transport messaging account settings.

When you build the solution, a setup file is created. You can launch it to configure all of the registry settings, and install the DLL.

To install the transport using the generated INF file
  1. On your workstation, navigate to the subfolder: \Transportdemo\Transportdemosetup\Debug\.

  2. Double-click the file TransportDemoSetup.inf.

Remarks

The transport in this code sample does not actually synchronize e-mail using a protocol. It just demonstrates how to construct a messaging transport.

Development Environments

SDK:Windows Mobile Professional SDK and Windows Mobile Standard SDK

Development Environment:Visual Studio 2005 or 2008.

ActiveSync:Version 4.5.

See Also