application development for windows ce devices frank prengel embedded developer evangelist microsoft...
TRANSCRIPT
Application Developmentfor Windows CE Devices
Frank PrengelEmbedded Developer EvangelistMicrosoft Germany
What you will learn
• Quick facts: What is Windows CE?
• What does „development“ mean?
• Visual Studio 2005 for Devices
• Developing native & .NET applications
• Creating & using a custom device SDK
• Future tools: Windows CE "6"
Windows MobileSmartphone
Functionality
Windows XP
Tablet PC
Windows MobilePocket PC Phone
Smart Personal Objects
.NET MicroFramework
Notebook PC
Windows Automotive
Portable Media Center
VoIP Phones
MobileHandhelds
GatewaysSet-top Boxes
Medical DevicesWindows-based
Terminals
Thin Clients
Entertainment Devices
Retail Point-of-Sale
.netcpu
Office Automation
ATMs / Kiosks
Industrial Automation
Set-top Box
•A small embedded 32-bit OS
•Virtual memory & multithreading
•Componentized & configurable
•Hard real-time capabilities
•Multiple CPU architectures (ARM, x86, SH4, MIPS)
•Subset of Win32 API
•Comes with source code (!)
•Lots of features...
Quick facts: What is Windows CE?
Platform Builder
ConfigurationConfiguration
BuildBuild
DownloadDownload
Device UnderDevelopment
Device Emulation
DebugDebug
BSP(OAL, Boot Loader, Drivers)
BSP(OAL, Boot Loader, Drivers)
Export SDKExport SDK
Embedded Visual C++
Visual Studio 2005
Standard SDKStandard SDK
OEM ISV
What does „development“ mean?
C# / VB.NETC# / VB.NET
.NET CompactFramework 2.0
.NET CompactFramework 2.0
C/C++ C/C++
Win32 Win32
Windows CE 5.0 Operating SystemWindows CE 5.0 Operating System
Visual Studio 2005
eMbedded Visual C++
eMbedded Visual C++
PlatformBuilder
PlatformBuilder
Development Tools for Windows CE
Native Applications .NET Applications
• Builds the OS Builds the OS from source code + binary librariesfrom source code + binary libraries
• Can Build C/C++ applicationsCan Build C/C++ applications• ... that become part of the OS image... that become part of the OS image
• Reduced IDE Code editor supportReduced IDE Code editor support
• Win32, MFC, ATL, ...Win32, MFC, ATL, ...
• Kernel debuggerKernel debugger
• Remote ToolsRemote Tools
• Emulator (x86)Emulator (x86)
• This is the tool for OEMs,This is the tool for OEMs,not ISVsnot ISVs
Platform Builder
Source!
• Similar to Microsoft Visual C++ V6.0Similar to Microsoft Visual C++ V6.0• Source code branch from VS6Source code branch from VS6
• Special features specific to Windows CESpecial features specific to Windows CE• Built in compilers and linkers for supported processorsBuilt in compilers and linkers for supported processors
• Debug tools, remote tools, and platform managerDebug tools, remote tools, and platform manager
• Emulation environment to develop without deviceEmulation environment to develop without device
• Support for CE 5.0 w/ SP4 & SDKSupport for CE 5.0 w/ SP4 & SDK
eMbedded Visual C/C++ 4.0
• First released: 4/4/2002First released: 4/4/2002
• Mainstream support ends: 6/30/2007Mainstream support ends: 6/30/2007
• Public download ends: June 2007Public download ends: June 2007
• Extended support ends: 6/30/2009Extended support ends: 6/30/2009
• Online support ends: 6/30/2013Online support ends: 6/30/2013
Migrate rather sooner than later Migrate rather sooner than later
eVC++ Support Life Cycle
Novices
Enthusiasts
Students
Hobbyists
Part-Timers
Professionals
Consultants
Enterprise Devs
Architects
Testers
VB6 Devs
Visual Studio 2005: State of the Art
• Device development w/ Standard Edition & aboveDevice development w/ Standard Edition & above
• Replaces Visual Studio .NET for "managed" Replaces Visual Studio .NET for "managed" developmentdevelopment• CF 1.0 & 2.0CF 1.0 & 2.0
• Replaces eMbedded Visual C++ for native Replaces eMbedded Visual C++ for native developmentdevelopment• MFC 8.0, ATL 8.0, STL, CRTMFC 8.0, ATL 8.0, STL, CRT
• New tools (designer, data, ...)New tools (designer, data, ...)
• New device emulator (ARM based)New device emulator (ARM based)
• Deployment & SigningDeployment & Signing
Visual Studio for Devices
• Device Development in C/C++Device Development in C/C++• Migrate projects from eMbedded Visual C++ 4.0Migrate projects from eMbedded Visual C++ 4.0
• Updated Device Compilers and Native Libraries Updated Device Compilers and Native Libraries
• Orders of magnitude faster native debuggerOrders of magnitude faster native debugger
• Microsoft SQL Server 2005 Mobile EditionMicrosoft SQL Server 2005 Mobile Edition
• Remote Tools for DevicesRemote Tools for Devices
• Code Snippets Code Snippets
• Support for Device CAB (Setup) ProjectsSupport for Device CAB (Setup) Projects
More Enhancements
VisualVisualStudioStudioVisualVisualStudioStudio
Windows CEWindows CE Windows CEWindows CE
Low level operating system-specific Low level operating system-specific functionalityfunctionality
ThreadsThreads MemoryMemory File I/OFile I/O
NetworkingNetworking LocalizationLocalization
CLRCLR CLRCLR
Type systemType system LoaderLoader JIT CompilerJIT Compiler
Execution Engine provides typesafe Execution Engine provides typesafe runtime for managed coderuntime for managed code
Garbage collectorGarbage collector DebuggerDebugger
FXFX FXFX
Rich class libraries to make your life Rich class libraries to make your life easy!easy!
GUI: Forms GUI: Forms GUI: Drawing (2D & 3D)GUI: Drawing (2D & 3D) CollectionsCollections IO, Networking, CryptoIO, Networking, Crypto
Native interopNative interop Web servicesWeb services Data & XmlData & Xml GlobalizationGlobalization
.NET Compact Framework
CF 2.0CF 2.0 CF 1.0CF 1.0
WinCE 5.0WinCE 5.0 + (RTM)+ (RTM) ++
WinCE 4.1, 4.2WinCE 4.1, 4.2 o (SP1)o (SP1) ++
CF: OS & Tools Support
CF 2.0CF 2.0 CF 1.0CF 1.0
WinCE 5.0WinCE 5.0 VS2005VS2005 --
WinCE 4.1, 4.2WinCE 4.1, 4.2 -- VS.NET 2003VS.NET 2003
• DebuggingDebugging• Attach to Process, Just-in-time (JIT), Post-mortem (kdump)Attach to Process, Just-in-time (JIT), Post-mortem (kdump)
• Code SigningCode Signing• Adding test certificates, Signing and provisioningAdding test certificates, Signing and provisioning
• EmulatorEmulator• ActiveSync, Folder sharing, Save StateActiveSync, Folder sharing, Save State
• Multi-platform developmentMulti-platform development
• Unsupported:Unsupported:• Interoperability debugging, driver development, Interoperability debugging, driver development,
Edit and ContinueEdit and Continue
Native Development – Some Facts
• Possible to mix & match native & managed projects Possible to mix & match native & managed projects in one solutionin one solution• Be sure to target the same platform...Be sure to target the same platform...
• Build order, dependencies, deployment dirs, etc., Build order, dependencies, deployment dirs, etc., can be specifiedcan be specified
• No seamless debugging at this pointNo seamless debugging at this point• Can't attach native & managed debugger at the same Can't attach native & managed debugger at the same
timetime
• Set reg key to enable attaching the managed debugger to Set reg key to enable attaching the managed debugger to a running process (CF 2.0 only!)a running process (CF 2.0 only!)
Mixing native & managed code
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETCompactFramework\Managed Debugger]
"AttachEnabled"=dword:00000001
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETCompactFramework\Managed Debugger]
"AttachEnabled"=dword:00000001
.NET!
native!
Developing an Application
• What you need:• Visual Studio 2005
• Device & SDK or
Emulator & SDK
• Connectivity• USB, ethernet, DMA (emulator)
Creating a Device SDK
• Use Platform Builder SDK Wizard:
Creating a Device SDK for VS2005
• Some things to note:• You must use the VS2005 Emulator BSP
• Include the necessary stuff (.NET CF, toolhelp, app installer, ActiveSync, etc.)
• If you want to support debugging without ActiveSync, include connection manager files in image (see later)
• Uncheck "Enable CE Target Control Support (SYSGEN_SHELL=1)" and "Enable KITL (no IMGKITL=1)"
• If you want to include a VS2005 emulator image, use the VS2005 Device Emulator BSP (http://tinyurl.com/gnhmd), and follow the instructions included in"Using the CE DeviceEmulator.rtf"
Using a device SDK with VS2005
• Install SDK on development machine• New platform available for native development
• Managed development is SDK-(quasi)independent
• Configure your emulator image if necessary
• Connect using ActiveSync, DMA (emulator), or ...
Debug without ActiveSync
• Without AS, VS2005 does not automatically copy connectivity binaries to device• Must do it yourself, or include them in the device image
• You need Clientshutdown.exe, ConmanClient2.exe, CMaccept.exe, eDbgTL.dll, TcpConnectionA.dll from \Program Files\Common Files\Microsoft Shared\CoreCon\1.0\Target\wce400\<CPU>
• Manually launch ConmanClient2.exe on device
• Set correct device IP address in VS2005
• Run CMaccept.exe on device• You have 3 minutes to connect now
• For more details seehttp://msdn2.microsoft.com/en-us/library/ms228708.aspx
Does it have to be that hard?
Introducing Windows CE "6"
• Next-generation kernel
• Backward compatibility
• Enhanced robustness and security
• User-mode driver model
• Updated development tools
• No regressions on performance and size
• Plus many more new features
Platform Builder 6
Latest-and-greatest Editors and IntellisenseLatest-and-greatest Editors and Intellisense
One set of tools for desktop, Windows CE kernel, One set of tools for desktop, Windows CE kernel, and Windows CE applicationsand Windows CE applications
Automation supportAutomation support
BenefitsBenefits
IDE tools: Visual Studio 2005 add-onIDE tools: Visual Studio 2005 add-on
Integrated into Visual Studio 2005Integrated into Visual Studio 2005
Documentation integrated with Visual Studio 2005Documentation integrated with Visual Studio 2005
Updated catalog functionalityUpdated catalog functionality
Device Emulator integrated into Platform BuilderDevice Emulator integrated into Platform Builder
New editorsNew editors
New debugger transports supportedNew debugger transports supported
Postmortem debuggingPostmortem debugging
Platform Builder 6 Tools
Runtime Image ViewerRuntime Image Viewer
What you have learned
What is Windows CE?
What does "development" mean?
Visual Studio 2005 for Devices
Developing native & .NET applications
Creating & using a custom device SDK
Future tools: Windows CE "6"
Enough...Enough...
Resources
• Windows Embedded Home
• http://www.microsoft.com/windows/embedded/
• Embedded development• http://msdn.microsoft.com/embedded
• Windows CE development• http://msdn.microsoft.com/embedded/windowsce/default.aspx
• Microsoft Windows CE eHow-tos and Tutorials• http://msdn.microsoft.com/embedded/
getstart/basics/tutorialsce/default.aspx
• Windows CE 6 Beta Virtual Labs
• http://msdn.microsoft.com/virtuallabs/windowsce/
Questions
© 2006 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.