Export (0) Print
Expand All
Expand Minimize

Push Messaging

Windows Mobile 6.5
4/8/2010

This code sample is named FileClient. It demonstrates how to implement a push-client that receives push-messages, saves the message's body to a file, and then calls ShellExecuteEx to perform an action on the file (which can be an executable file or a document).

fileclient.cpp

Contains functions for saving a file, getting user permissions, checking to see if the file type has permissions for download, and processing push-messages.

fileclient.h

Contains function prototypes and forward declarations for string constants.

fileclient.rc

The resource script.

main.cpp

Contains the application entry point.

precomp.h

Defines the precompiled header.

resource.h

the header file for the resource script.

string.cpp

Defines all constant string values.

utils.cpp

Contains functions for extracting data from the SMS header, and for copying strings.

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

    C:\Program Files\Windows Mobile 6.5.3 DTK\Samples\Common\CPP\Win32\fileclient

    Microsoft Visual Studio launches and loads the solution.

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

  3. Deploy the solution (F5).

To use the application
  1. Register the application by running it on the mobile device once with "/register" as the command-line argument.

  2. The application will execute when it receives an SMS message with X-WAP-Application-ID with a value of "fileclient".

Network coverage is required to receive push messages.

The Setup in a CAB code sample can be used to create a CAB file for deploying this application.

The value of the X-MS-FileName header field in the message's headers section specifies the name of the saved file.

Application parameters can be set by filling-in the X-MyCompany-Params header field.

The value of CSIDL_WINDOWS contains the name of the directory where the file is saved.

Since the message is traveling over the SMS transport, the maximum message size determines the maximum size of an application that can be pushed to a mobile device. Most Short Message Service Center's (SMSC's) limit this size to 64KB.

The Application ID of this push-client is "fileclient", To be intercepted by this push-client, a push-message must have a value of "fileclient" for the X-WAP-Application-ID header field.

SDK: Windows Mobile Professional SDK and Windows Mobile Standard SDK

Development Environment: Visual Studio 2005 or 2008.

ActiveSync: Version 4.5.

Community Additions

ADD
Show:
© 2014 Microsoft