Compact 2013 Ebook

15.3 XWE App in C++
Created by djones on 6/18/2013 9:23:02 AM

1. In the Visual Studio 2012 with Windows Embedded Compact project loaded,
select:
Menu Tools –> Windows Embedded XAML Tools —> Create Platform Builder Project

clip_image002

Figure 15.13: Accessing the XAML Subproject Wizard

clip_image004

Figure 15.14: The XAML Subproject Wizard start up dialog

2. On the next dialog call the project MyFirstXamlApp and for location browse to the location of the OS projects Subprojects (one deep from the folder that has the OS's .sln file). Note this is where the path not having and spaces comes into question. Build.exe can't handle spaces in paths.

clip_image006

Figure 15.15: XAML Subproject Wizard: Project details

  1. On the next dialog select the XAML Project created in Part A:
    Browse to the location of the project and drill down until you can select .csproj (or .vbproj) . Note this also is where the path not having and spaces comes into question. Build.exe can't handle spaces in paths.

clip_image008

Figure 15.16: XAML Subproject Wizard: Select the project from Blend

The startup control should be the MainPage:

clip_image010

Figure 15.16a: XAML Subproject Wizard: Selected project

3. Click [Next] to validate the project:

clip_image012

Figure 15.17: Validation Result Dialog

Note: If there were any spaces in the path, this would lead to an invalidation here.

4. Press [Finish] to complete. You will then get a Summary report:

clip_image014

Figure 15.18: Validation Report

5. Add this project to the OS project:

6. In the Solution Explorer Right-Click on Subprojects and select Add-Existing-Project:
(Note that the usual native projects exist under Add-New-project)

clip_image016

Figure 15.19: The OS Subprojects folder

7. Browse to the sources file (or use the .pbxml file) for the project created in this section and select it:

clip_image018

Figure 15.20: File Dialog showing XAML Subproject sources and .pbpxml files

8. Expand the subproject out to see all of its files:

clip_image020

Figure 15.21: The XAML project tree

Note that the XAML files remain in the original project so you can modify them from there (ie in Blend).
If you try to open them here you get garbage.


Examine the source files. The project is:

  • A proper Windows Embedded Compact sources subproject
  • An XAML project
  • A C++ native app.

9. Set the subproject properties to build as debug and exclude form the image. In the OS Properties page (Subproject Image Settings). That way you can modify it while the OS is running:

clip_image022

Figure 15.22: Subproject build settings

10. Right-Click on the subproject and build it

11. Run the OS and test the app through target control.
This assumes you have a prebuilt OS with Target Control Support (Shell.exe) and with KITL enabled, typically in Retail mode.

clip_image024

Figure 15.23: Adding Target Control Support to the OS

clip_image026

Figure 15.24: KITL (OS Project Property-Build Options)

12. Test the app.

Note: The C# event handler code hasn't been translated to C++.
The buttons don’t work.
Examine MainPage.cpp file.
The event handlers are there. The C# code wasn’t translated!

clip_image028

Figure 15.25: The app running on Windows Embedded Compact system.

13. Use target control to shut down the application using gi proc and kp Target Control commands as shown. Target Control is actioned using the menu: Target—>Target Control

Windows CE>gi proc
PROC: Name PID AcctId VMBase CurZone
P00: NK.EXE 00400002 00000000 80220000 00000000
P01: CeLogFlush.exe 01290006 00000000 00010000 00000000
P02: shell.exe 012b0006 00000000 00010000 00000000
P03: udevice.exe 01500006 00000000 00010000 00000000
P04: udevice.exe 00de000a 00000000 00010000 00000000
P05: dmsrv.exe 019a0016 00000000 00010000 00000003
P06: servicesd.exe 03ec000e 00000000 00010000 00000000
P07: GweUser.exe 027e001a 00000000 00010000 00000000
P08: xrshell.exe 037a0032 00000000 00010000 00000000
P09: MyFirstXAMLApp.exe 03890042 00000000 00010000 00000000
Windows CE>kp 09
Attempting to kill process of id 03890042 ...Succeeded
  • The 09 is the Process Id less the leading P character.
  • gi proc lists the processes running on the target
  • kp XY kills the process PXY

NEXT: 15.4 XAML Time Button Event Handler Code

print

Click here to provide feedback and input

  Comments

There is no comment.

Turkish porno izle video site in rokettubeporno izle