Share via


Making a Data Connection Using Connection Manager (Windows Embedded CE 6.0)

1/6/2010

This topic describes how an application establishes a data connection by using Connection Manager. You can use Connection Manager to establish one of the following data connection types:

  • Bluetooth Dial-up Networking (DUN) by using the CSPRas connection service provider (CSP).
  • ActiveSync Desktop Pass-through (DTPT) by using the CSPNet connection service provider.
  • Wireless LAN (WLAN) connection by using a wireless adapter and the CM_NetEntries configuration service provider. Connection Manager can only access an existing WLAN connection.
  • GPRS connection by using a GSM radio and the CM_GPRSEntries configuration service provider.

For more information about Connection Manager, see Connection Manager Overview.

Hardware and Software Assumptions

  • **You have installed Platform Builder for Windows Embedded CE 6.0.
  • You have already created the source code for your application functionality. You want to create a basic framework for the application code so that you can add connectivity to it by using Connection Manager, and then run it on a Windows Embedded CE powered device. For more information, see Creating a New Subproject.
  • You have already added the application to the run-time image. For more information, see Adding an Existing Subproject to an OS Design and Updating the Project.bib File.
  • The device that will support your application includes support for the Connection Manager catalog item (SYSGEN_CONNMGR). To create certain types of connections, you must also include additional catalog items, described below.
    • For a connection that uses Bluetooth Dial-up Networking (DUN), also include the Bluetooth Catalog item (SYSGEN_BTH).
    • For a connection that uses Desktop Pass-through (DTPT), also include ActiveSync and File Sync Catalog Items (SYSGEN_AS_BASE and SYSGEN_AS_FILE).
    • For a connection that uses a built-in GSM radio, also include the Cellcore catalog item (SYSGEN_CELLCORE).
    • For a connection that uses a wireless LAN (WLAN), also include the Wireless LAN 802.11 STA catalog item (SYSGEN_ETH_80211).
  • The device is already configured for Connection Manager. This includes the appropriate configuration service provider, for example, CM_NetEntries for DTPT or WLAN, and CM_GPRSEntries for GPRS. For more information, see Connection Manager Configuration.
  • The device includes hardware appropriate to the type of connection:
    • For DTPT, a desktop PC connected with ActiveSync to the portable navigation device.
    • For GPRS, a GSM radio in the portable navigation device and access to a GSM network through the mobile operator.
    • For WLAN, a wireless network adapter in the portable navigation device and a connection to a wireless access point (WAP).

Steps

Step More information

1. In Platform Builder, open the subproject for the connected application.

  1. On the File menu, point to Open, then click File.
  2. In the Open File box, in the Files of type list, click Projects (.pbpxml).
  3. Browse to the project file, select it, and click Open.

No further information

2. Select the GUID for the connection that you want to create and use.

For example, to let Connection Manager determine which connection to use, select the GUID constant IID_DestNetInternet.

No further information

3. Create an application framework that includes a window class and a message loop to handle status notifications from connection manager.

Note that when you create the window class by calling CreateWindow, the return value is a handle to the application main window. You can use this handle later to post a message to the main window.

Creating a Window

Creating a Sample Application

4. In the application source code, add code to establish a connection before the application executes the connected functionality, such as connecting to the Internet.

Establishing an Internet Connection Using Connection Manager

5. In the callback function for the main window WndProc, add cases for the Connection Manager Status Constants that you want the application to handle.

Handling Connection Status Notifications

6. Rebuild the application.

  • On the Build menu, click Build Project Name.

No further information

7. (Optional) For a device that supports DTPT, create a menu in the device user interface (UI) that enables users to connect to a computer through ActiveSync. Then, create user documentation that describes how to connect to a computer.

No further information

See Also

Concepts

Connection Manager How-to Topics
Connection Manager ActiveSync Desktop Pass-through (DTPT)

Other Resources

Connection Manager Application Development