Download presentation
Presentation is loading. Please wait.
2
Programming With eMbedded Visual C++ 4.0
Paul Yao The Paul Yao Company
3
Windows Mobile Development Platform: Today
Embedded VC++ Visual Studio .NET Native Win32 MFC ATL Managed .NET Compact Framework Server side ASP .NET Mobile Controls Native Win32 MFC ATL Managed .NET Compact Framework Server side ASP .NET Mobile Controls Software Platform (APIs) Home Screen User Interface/Shell HTML Control GAPI Remote API Configuration Bluetooth Security Connection Manager TAPI SMS MAPI POOM ActiveSync Multimedia Communication Device Management Presentation ADO CE XML CE DB OLE DB Data Access Microsoft provides you with a unified and consistent development platform, so that the device hardware is abstracted away, and you can concentrate on creating compelling applications that will run on all Windows Mobile-based devices. Above the device hardware and drivers, the Windows Mobile platform, based on Windows CE as the core OS, provides a familiar user experience and applications, such as Windows Media player, Pocket Outlook and Pocket Internet Explorer. The platform is exposed to you through rich API support allowing you flexibility and control, for a variety of scenarios. <Describe some APIs such as Connection Manager, Config Manager, GAPI, etc.) There are different approaches and tools for developing and running your applications: Native – for client-side, low-level applications, use Embedded VC++ 3 or 4 Managed (.NET CF) – for most client-side, managed code applications, use Visual Studio .NET Mobile Web (ASP .NET Mobile Controls)– for server-side applications, use Visual Studio .NET Windows Mobile CE DB ActiveSync Pocket Outlook Pocket Internet Explorer Windows Media Player Windows CE Drivers Display USB or Serial Processor Memory GSM/GPRS CDMA/1xRTT Device Hardware WiFi Bluetooth Radio
4
Agenda Part 1: The Tools Part 2: Tool Tips Part 3: Native or Managed?
5
Part 1: The Tools What is eMbedded Visual C++ 4.0?
New features since eVC++ 3.0 C++ Enhancements Remote Tools
6
What Is eVC++ 4.0? Stand-alone development environment
Build “native” executables Languages: C, C++ APIs: Win32 API, MFC Template Libraries: ATL & WTL Companion to Visual Studio .NET 2003 Build “managed” executables Languages: C#, Visual Basic .NET API: .NET Compact Framework
7
New Features in eVC++ 4.0 Since eVC++ 3.0
Improved emulator Greater fidelity to device OS image ActiveSync connections (via network virtual switch) Improved Debugging Attach to running process JIT attach to hung process
8
C++ Enhancements C++ structured exception handling
try catch throw Runtime Type Information (RTTI) Standard Template Library (STL)
9
Remote Tools eVC++ 3.0 & eVC++ 4.0
Remote Spy++ Remote Registry Editor Remote Heap Walker Remote Process Viewer Remote Zoomin Remote File Viewer
10
Remote Tools New with eVC++ 4.0 (1/2)
Remote Call Profiler “Testing Real-Time Systems in Windows CE .NET” by Mike Hall and Steve Maillet Remote Kernel Tracker Processes Threads Interrupts
11
Remote Tools New with eVC++ 4.0 (2/2)
Remote Performance Monitor Graphical display with continual monitoring Tracks: CPU usage, threads, processes, memory, network traffic, battery, among other values Remote System Information Snapshot of system state Shows: OS version, CPU info, OEM code page, memory, power state, object store usage, active devices (COM1:, COM2:, etc.), user-interface colors, system metrics
12
Part 2: Tool Tips Setup Text Editor Project Settings Linker Emulator
Debugger Tips
13
Setup Tip #1: Use the right tool…
eVC++ 3.0 For Windows CE 3.0 Pocket PC Pocket PC 2002 Smartphone 2002 eVC++ 4.0 For Windows CE .NET version 4.0 version 4.1 version 4.2 Pocket PC 2003 Smartphone 2003
14
Setup Tip #2: eVC++ 4.0 Upgrade to Service Pack 3
Before – SP tied to OS version: Windows CE 4.0 – no service pack Windows CE 4.1 – required SP1 Windows CE 4.2 – required SP2 SP3 Supports: Windows CE 4.0 Windows CE 4.1 Windows CE 4.2 Recommendation: Upgrade – today!
15
Setup Tip #3: Use latest version of ActiveSync
Devices and Version Pocket PC – ActiveSync 3.1 Pocket PC 2002 – ActiveSync 3.5 Smartphone 2002 – ActiveSync 3.6 Pocket PC 2003 – ActiveSync 3.7 Smartphone 2003 – ActiveSync 3.7.1 Reference: Chris De Herrera’s Web site
16
Setup Tip #4: Install RTTI on PPC 2003
Pocket PC 2003 – does not support… C++ structured exceptions Run-time Type Information (RTTI) Standard Template Library (STL) Support can be added: Download RITTI.EXE from MS web site Portions install on development system Portions install on device Google® for… “RTTI Pocket PC” or “KB830482”
17
Text Editor Tip: Use keyboard shortcuts
[F1] - Context Sensitive help [F4] - [Next] (Error, Search result, etc.) [F6] - [Next Window] [F9] - [Set Breakpoint] at cursor [Tab] - Indent blocks of text [Ctrl] + [End] – Enable auto scroll for output windows (build, debug, find)
18
IDE Tip For Project Settings: Use ‘All Configurations’
19
Linker Tip Finding missing functions
Example: Where to find "MailOpen", "MailPut", and "MailClose" The Answer: msgstore.lib Solving the general case: C> dumpbin –linkermember:2 msgstore.lib>msgstore.dat C> dumpbin –linkermember:2 msmqrt.lib > msmqrt.dat
20
Emulator Tip: Getting Set Up
Operating System: Use Win 2000 sp2, or WinXP Cannot use Win 9x/Me Communications: Requires TCP/IP (Internet) Protocol Machine Name must start with letter Tip: Login with Administrator privileges Install Microsoft Loopback Adapter
21
Debugger Tip #1: USB/Serial Connection
Establish ActiveSync Partnership Use latest version (3.7.1) Select correct CPU (WCE Configuration Toolbar) For best performance, hide Watch and Variables windows Consider using network debugging…
22
Debugger Tip #2: Using a Network At Home (no DHCP)
Establish partnership via USB/serial Static IP address on desktop Static IP Address on smart device Set WINS address to desktop IP address Start->Settings-> [Connections] [Network] [Adapters] <Select Adapter> [Name Servers]
23
Debugger Tip #3: Using a network At Work (with DHCP)
Desktop-Side Enable network connections Connect via USB/serial Device-Side Enable network connections in ActiveSync Enable DHCP for network adapter Attach network adapter Might need to reset device Connect to Network Wired Wireless
24
Part 3: Native Or Managed?
Which is better? A comparison When to use native code / managed code Bridging the gap P/Invoke The P/Invoke Wizard Building Native DLLs Compiler Download native DLLs for managed projects from Visual Studio .NET
25
A Comparison Native Code C/C++ & Win32 API EXEs & DLLs
Native CPU instructions Portable source code Manual cleanup ActiveX / COM No run-time required (OS is the runtime) Managed Code C#/VB.NET & .NET CF EXEs & DLLs IL instructions; JIT to native CPU instructions Portable binary code Garbage Collection COM not supported Run-time required 2.0 MB footprint Requires support from underlying Windows CE operating system In ROM for all Windows Mobile devices
26
When To Use… Native code…
Device drivers Shell extensions Today screen Control panel Custom input panel Skinnable UI Serial port I/O Application setup (CESetup.dll) Remote API (RAPI) for device-side DLL Web service server Real-time threads CE property databases ActiveX / COM ActiveSync provider Mail API (MAPI) Native XML parser Object exchange (OBEX) Pocket Outlook Object Model (POOM) Wrapper for COM library Callable from managed code
27
When To Use… Managed code…
On devices with .NET Compact Framework Windows Mobile 2003-based devices Custom display-based smart devices GUI application code Forms, controls custom controls Web service clients Database (ADO.NET) clients Build managed DLLs Shared class libraries Custom controls Managed code benefits: Well designed API Automatic garbage collection Portable binary files Interoperability with desktop .NET Framework
28
Bridging The Gap Platform Invoke (P/Invoke)
Managed code feature Supports calling native DLLs C-callable function names (not C++ ‘mangled’ names) Parameter types w/built-in support: Blittable types – integers (8, 16, 32 bit), strings Arrays of blittable types Other parameter types require more effort: Character arrays within structures Nested objects Unions
29
A Helper: The P/Invoke Wizard
Download from:
30
Building DLLs Problems with C++ “name decorating”
An Include File: #include "MyLen.h" The Source Code (MyLen.cpp): _declspec(dllexport) int _cdecl MyLen(char * p) { return 4; } Resulting Exported Function:
31
Building DLLs Unmangling function names
Solution: // MyLen.H #ifdef _cplusplus extern "C" { #endif _declspec(dllexport) int _cdecl MyLen(char * p); } Resulting Exported Function: MyLen
32
Managed Code Project Tip Downloading native DLLs
In VS .NET Solution Explorer Add->Add Existing Item Set Build Action = “Content” Example: Add “Helper.dll” Downloaded with executable
33
Wrap-Up eVC++ 4.0: Contact Us: info@paulyao.com
Native code for Windows CE .NET 4.x Upgrade to Service Pack 3 Certain scenarios require native code Build native DLLs to support managed code Contact Us: The Paul Yao Company’s Weekend Warrior Workshops for Windows Mobile programmer Other training workshops Our online eCoaching for Programmers series
34
After This Session… Visit the Windows Mobile booth to:
Get the Windows Mobile Developer Resource Kit and start supporting landscape and high DPI Talk to the Technical Support team Join the Windows Mobile Solutions Partner Program Enter the Microsoft Mobile2Market Application Contest Fill in your evaluation form sponsored by AT&T Wireless 1 MPX200 given away per session. See The Developer Resource Kit contains tools, SDKs and white papers to get started developing for devices up to and including Second Edition today The Technical support team are at the booth and are there to try to answer your technical questions If you haven’t already, go to the booth to register for our free Windows Mobile Solution Partner Program - we are offering free t-shirts and a chance to win a device If you already have an application or are planning to build one soon, join the Mobile2Market application contest – we’re giving out 4 $25,000 prizes and retail distribution for winning apps Insert only sessions that follow yours and are pertinent to the information you have presented or you think will be interesting. You can insert none, one or more than one
35
Your Questions…
36
Thank You!
37
© 2004 Microsoft Corporation. All rights reserved.
MICROSOFT CONFIDENTIAL. INTERNAL USE ONLY.
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.