WEC7: Application Development

From Compulab Mediawiki
Revision as of 14:37, 6 March 2012 by Shahal (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Installing the SDK

Windows CE application development with Visual Studio 2008 (VS2008) requires installation of device-specific SDK supplied by CompuLab. To install the SDK follow the below procedure:

  • 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 2008.
  • 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
Admolition note.png The SDK installer is a wizard based installer, you can click through the default settings to install the SDK

Creating an Application

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

C# Application (VS2008)

  • Start a new instance of Visual Studio 2008
– you will use the new instance of Visual Studio 2008 to write and deploy your application.
  • Within Visual Studio 2008 select File->New->Project
File:OpenNewProjectScreenVS2008.png
  • Select Project type: Other Languages | Visual C# | Smart Device
  • Choose Smart Device Project
  • Click OK to create the Smart Device application
File:NewCSharpProjectVS2008.png
  • To develop an application choose Device Application and select the appropriate Target Platform.
File:NewCSharpProject2VS2008.png
  • 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


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 (VS2008)

  1. Run Expression Blend 3.
  2. A menu will popup, select new project.
    - File:ExpressionBlendNewProjectVS2008.png
  3. Select a Silverlight for Windows Embedded Application
    - File:ExpressionBlendEmbeddedProjVS2008.png
  4. Create content and save the Expression Blend project.
  5. Start VS 2008 and select Tools->Windows Embedded Silverlight Tools->Create Platform Builder Subproject.. menu option.
    - File:WEC7 Silverlight subproject.png
  6. Name the application and select a location for the converted subproject and press Next.
    - File:WEC7 Silverlight subproject 2.png
  7. Select the .csproj created originally by the Expression Blend and press Next.
    - File:WEC7 Silverlight subproject 3.png
  8. No errors window should appear, which means your project has been converted successfully.
    - File:WEC7 Silverlight subproject 4.png
  9. Go to the Solution Explorer, right click the Subprojects and select Add Existing Subproject..
    - File:SubprojectsContextMenuAddExistingSub.png
  10. Browse to the converted subproject you set four stages ago, select the sources file and press open.

MFC Application (VS2008)

After installing the SDK, there are a few Microsoft fixes and updates to install:

Admolition note.png Installation must be done in the specified order
  1. Windows Embedded Compact 7 Update 3
  2. Visual Studio 2008 update for Windows Embedded Compact 7
  3. Windows Embedded Compact 7 ATL Update for Visual Studio 2008 SP1

After installing the above 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 2008
– you will use the new instance of Visual Studio 2008 to write and deploy your application.
  • Within Visual Studio 2008 select File->New->Project
File:OpenNewProjectScreenVS2008.png
  • Select Project type: Visual C++ | Smart Device
File:NewProjectMFCVS2008.png
  • 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…

File:PrjectWizardVS20081.png
Admolition note.png The default settings are to build an application for Windows Mobile 5.0 Pocket PC 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 Windows Mobile 5.0 Pocket PC, you will need to remove Windows Mobile 5.0 Pocket PC and add the SDK you installed in the first step
File:ProjectWizardPlatformVS2008.png
  • Select Windows Mobile 5.0 Pocket PC in the list of Selected SDKs
  • Click the WizardRemoveArrow.jpg button to move Windows Mobile 5.0 Pocket PC 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_T35_WEC7 into the selected SDKs list
File:ProjectWizardPlatformWithSelectedSDKVS2008.png

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).

  • 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