WinCE: Application Development

From Compulab Mediawiki
Revision as of 09:03, 23 December 2009 by Nadav (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Installing CompuLab's SDK

In order to develop applications for Compulab's modules, using Visual Studio 2005 (VS2005), Compulab's SDK must be installed.
The SDK installation file is located in the Software Package. To install the SDK, follow these steps:

  • Run the <Platform name>_SDK.msi file – this will install the SDK into the Add/Remove programs within control panel and also make the platform available to Visual Studio 2005.


Admolition note.png The SDK installer is a wizard based installer, you can click through the default settings to install the SDK
  • On the first page of the SDK installer – Click Next
  • On the second page of the SDK installer – Accept the EULA and Click Next
  • On the third page (customer information) of the SDK Installer – Click Next
  • On the fourth page (setup type) of the SDK Installer – Click Complete
  • On the fifth page (destination folders) of the SDK Installer – Click Next
  • On the Final page of the SDK installer – Click Install
  • To complete the installation of the SDK – Click Finish

Creating an Application

To Deploy an application to the device an ActiveSync connection is necessary between the device and the desktop machine.

C# Application (VS2005)

  • Start a new instance of Visual Studio 2005
– you will use the new instance of Visual Studio 2005 to write and deploy your application.
  • Within Visual Studio 2005 select File->New->Project
OpenNewProjectScreen.jpg
  • Select Project type: Other Languages | Visual C# | Smart Device | Windows CE 5.0
  • To develop an application choose Device Application
  • Click OK to create the Smart Device application
NewCSharpProject.jpg
  • You are now ready to add controls and functionality to your form.


Admolition note.png Applications developed using VS2005 target the .Net Compact-Framework 2.0

To target .Net Compact-Framework 3.5 develop the application using VS2008

Deploy a C# Application to your device

  • Press the Green play button to deploy and run the program
DeplyButton.jpg
  • From the list of available devices choose either Windows CE 5.0 device or the SDK of the device you work with
DeployDeviceList.jpg
  • Press Deploy

VS2005 .Net CF 2.0 Update

When deploying a C# application your breakpoints may not be hit.
To fix this, install the .Net CF 2.0 SP2 on your desktop machine

Embedded Silverlight Application (VS2005)

With the new Windows CE 6.0 R3 release, it is now possible to develop Silverlight applications for Windows CE.
Silverlight for embedded devices is based on Silverlight 2 core engine, only ported to native code. To read more on Silverlight for Windows CE please refer to:

With Compulab’s SDK, it is possible to develop Silverlight application without the use of Platform Builder.
To build a Silverlight applications follow the steps described in MFC Application VS2005, and make sure you add the library “xamlruntime.lib” to the project’s input property under linker

AddingXamlLibToProject.jpg

MFC Application (VS2005)

After installing the SDK, you can write and deploy an MFC Smart Device application.

  • Minimize the current instance of Visual Studio/Platform Builder
  • Start a new instance of Visual Studio 2005
– you will use the new instance of Visual Studio 2005 to write and deploy your application.
  • Within Visual Studio 2005 select File->New->Project
OpenNewProjectScreen.jpg
  • Select Project type: Visual C++ | Smart Device
NewProjectMFCVS2005.jpg
  • Change the Project name to MFCApp
  • Click OK to create the Smart Device application.

The MFC application wizard requires that you provide information about the application you want to build, this includes the platform you want to build for, whether the application is Doc/View based etc…

PrjectWizardVS20051.jpg
Admolition note.png The default settings are to build an application for Pocket PC 2003 as a single document interface (SDI) application
  • Select the Platforms option on the left side of the wizard or press Next
- The Platforms page of the wizard allows you to select which platform (SDK) the application will be built against
– The default option is to build for Pocket PC 2003, you will need to remove Pocket PC 2003 and add the SDK you installed in the first step
ProjectWizardPlatform.jpg
  • Select Pocket PC 2003 in the list of Selected SDKs
  • Click the WizardRemoveArrow.jpg button to move Pocket PC 2003 out of the Selected SDKs list
  • Select the desired SDK from the list of Installed SDKs
  • Click the WizardAddArrow.jpg button to move the CM_X300_SDK into the selected SDKs list
ProjectWizardPlatformWithSelectedSDK.jpg

Now that the Platform has been configured you can review/set some of the application specific options:

  • Click on Application Type on the left side of the dialog.

The default option for an MFC application is to build a single document interface (Multiple Document Interface applications [MDI] are not supported on CE based devices) and to have MFC statically linked to your application. This is fine if you only have one MFC application running on a device. For this example you will change the default option to use MFC dynamically linked (ideal for supporting multiple MFC applications on the same device).

  • Change use of MFC from Use MFC in a Static Library to Use MFC in a Shared DLL

Feel free to explore some of the other wizard settings for the MFC application, at this point you have configured the basic options for the application.

  • Click Finish to allow the MFC application source to be generated