AXSample

Send Feedback

This code sample is named AXSample. It demonstrates how to use ATL to create an ActiveX control, and how to access that control in a web page.

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 CE Tools\wce500\Windows Mobile 5.0 Smartphone SDK\Samples\CPP\ATL\AXSample\AXSample.sln

    Microsoft Visual Studio 2005 launches and loads the solution.

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

  3. Open to the AxSample project properties.

  4. Navigate to Configuration Options > Debugging.

  5. Set the Debugger to Launch to Smart Device Native Debugger.

  6. Set the Remote Executable to \windows\iexplore.exe.

  7. Set the Command Arguments to \Program Files\AxSample\AXSample.htm.

  8. Deploy the solution (F5).

    The sample is copied to the device, and is registered. Internet Explorer Mobile then automatically launches and navigates to axsample.htm.

To debug the code sample

  1. Load the AxSample.HTML file with Internet Explorer Mobile.
  2. Try clicking various buttons, circles, etc that have been displayed.

To install the certificate from the windows desktop

  1. Click Start > Run.

  2. Type the path-name to SDKSamplePrivDeveloper.pfx certificate, and click OK. By default, this is located in the following folder:

    C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Tools\
    
  3. Double-click the SDKSamplePrivDeveloper.pfx certificate icon. The Certificate Import Wizard appears.

  4. Click Next. The certificate path-name is filled-in.

  5. Click Next.

  6. Click Next (you do not need a password).

  7. Click Next. Accept the default options; automatically select the certificate store based on certificate type.

  8. 9. Click Finish.

See Mobile device Security Model for further details on how to install the SDK certificates onto the mobile device, and how to use the privileged SDK certificate to sign this application.

Source File Listing

  • axsample.cpp
    Implements functions exported via the .def file.
  • axsample.def
    DLL export definitions.
  • axsample.idl
    MIDL script file.
  • axsample.rc
    Resource script.
  • axsamplectl.cpp
    Implements the ActiveX entry points including OnDraw.
  • stdafx.cpp
    Defines precompiled type information.
  • axsamplectl.h
    Defines COM interfaces to ActiveX control.
  • resource.h
    Resource script header file.
  • stdafx.h.
    prEcompiled header

Requirements

Pocket PC SDK: Windows Mobile 5.0 Pocket PC SDK.
Smartphone SDK: Windows Mobile 5.0 Smartphone SDK.
Development Environment: Visual Studio 2005.
ActiveSync: Version 4.0.

See Also

Code Samples | Mobile Web Development | ActiveX Controls | ATL | COM

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.