Programming With eMbedded Visual C++

Download Report

Transcript Programming With eMbedded Visual C++

Programming With eMbedded Visual C++ 4.0

Paul Yao The Paul Yao Company http://www.paulyao.com

Windows Mobile Development Platform : Today

Embedded VC++ Visual Studio .NET

ASP .NET

Mobile Controls Software Platform (APIs)

Device Management

Remote API Configuration Bluetooth Security

Communication

Connection Manager TAPI SMS MAPI POOM ActiveSync

Presentation

Home Screen User Interface/Shell HTML Control

Data Access

ADO CE XML CE DB OLE DB

Multimedia

GAPI Windows Mobile Device Hardware Processor Memory Windows CE CE DB ActiveSync Pocket Outlook Pocket Internet Explorer Windows Media Player Drivers Display USB or Serial Radio GSM/GPRS CDMA/1xRTT WiFi Bluetooth

Agenda

Part 1: The Tools Part 2: Tool Tips Part 3: Native or Managed?

Part 1: The Tools

What is eMbedded Visual C++ 4.0?

New features since eVC++ 3.0

C++ Enhancements Remote Tools

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

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

C++ Enhancements

C++ structured exception handling

try catch throw

Runtime Type Information (RTTI) Standard Template Library (STL)

Remote Tools

eVC++ 3.0 & eVC++ 4.0

Remote Spy++ Remote Registry Editor Remote Heap Walker Remote Process Viewer Remote Zoomin Remote File Viewer

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 http://www.windowsfordevices.com/articles/A T2137345992.html

Remote Kernel Tracker Processes Threads Interrupts

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

Part 2: Tool Tips

Setup Text Editor Project Settings Linker Emulator Debugger Tips

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

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!

http://www.microsoft.com/downloads/details.aspx?FamilyID=5b b36f3e-5b3d-419a-9610-2fe53815ae3b&DisplayLang=en

Setup Tip #3: Use latest version of ActiveSync

 Latest Version: 3.7.1

 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 http://www.cewindows.net

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”

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)

IDE Tip For Project Settings: Use ‘All Configurations’

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

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

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…

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]