1 / 37

Developing Applications with eVC++ 4.0

Developing Applications with eVC++ 4.0. Paul Yao President The Paul Yao Company http://www.paulyao.com. Agenda. Highlights of eVC 4.0 Tool Tips TroubleShooting. Agenda – Part 1 / 3. Highlights of eVC 4.0 What is eVC++ 4.0? Windows CE .NET Enhancements C++ Enhancements The Right Tool…

deborah
Download Presentation

Developing Applications with eVC++ 4.0

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Developing Applicationswith eVC++ 4.0 Paul Yao President The Paul Yao Company http://www.paulyao.com

  2. Agenda • Highlights of eVC 4.0 • Tool Tips • TroubleShooting

  3. Agenda – Part 1 / 3 • Highlights of eVC 4.0 • What is eVC++ 4.0? • Windows CE .NET Enhancements • C++ Enhancements • The Right Tool… • Tool Tips • TroubleShooting

  4. What is eVC++ 4.0? • Stand-alone development environment • Supports C & C++ • Win32 API (.EXEs & .DLLs) • Also MFC & ATL support • “Native” executables • Companion to Visual Studio .NET 2003 • C# / VB .NET • .NET Compact Framework • “Managed” executables

  5. Windows CE .NET 4.1Enhancements • Standard SDK • Improved emulator • Kernel Independent Transport Layer (KITL) • .NET Compact Framework • CECONFIG.H • Shared source code (in Platform Builder) • Added 32MB memory for XIP-DLLs • Improved power management • http://msdn.microsoft.com/msdnmag/issues/02/07/default.aspx

  6. C++ Enhancements • C++ structured exception handling • try • catch • Throw • Runtime Type Information (RTTI) • Standard Template Library (STL)

  7. eVC++ 3.0 Windows CE 3.0-based smart devices Pocket PC Pocket PC 2002 Smartphone 2002 eVC++ 4.0 Windows CE .NET-based smart devices Pocket PC 2003 The Right Tool…

  8. Remote ToolseVC++ 3.0 & eVC++ 4.0 • Remote SPY++ • Remote Registry Editor • Remote Heap Walker • Remote File Viewer • Remote Zoomin • Remote Performance Monitor • Remote System Information

  9. Remote ToolsNew with eVC++ 4.0 • Remote Call Profiler • “Testing Real-Time Systems in Windows CE .NET” by Mike Hall and Steve Maillet • http://windowsfordevices.deviceforge.com/articles/AT2137345992.html • Kernel Tracker • Graphical display of process, thread, scheduling, & synchronization • Process Viewer

  10. Agenda – Part 2 / 3 • Highlights of eVC 4.0 • Tool Tips • IDE Keyboard Shortcuts • Preprocessor • Compiler • Linker • TroubleShooting

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

  12. PreprocessorPrecompiled Headers • Key Benefit - Faster Build time • Obstacles: • Understanding Setup • Automatic versus Manual • Establishing Default Settings

  13. Precompiled HeadersThree Modes Settings For: All Configurations Off Auto Manual

  14. Precompiled HeadersThe Meaning of “Through header” Use Precompiled Headers Up to and including stdafx.h #include "stdafx.h" #include "propsip.h" #include <commctrl.h> #include <aygshell.h> #include <sipapi.h>

  15. Precompiled HeadersSetup for Manual Mode (1 of 2) Select Source File “Create headers” for one source file

  16. Precompiled HeadersSetup for Manual Mode (2 of 2) Select Source File “Use headers” for all other source files

  17. Precompiled HeadersDefault Settings Select Project Sets default for new items added to project

  18. I486 WIN32 STRICT USA UNICODE _UNICODE _X86_ x86 UNDER_CE=$(CEVersion) _WIN32_WCE=$(CEVersion) _WIN32_WCE_EMULATION INTLMSG_CODEPAGE INTERNATIONAL PreprocessorSymbols

  19. PreprocessorSymbols (continued) • Windows CE Conditional Compilation • #ifdef UNDER_CE • Targeting a Specific Version • #if UNDER_CE == 300 • #if UNDER_CE >= 211 • Emulator-Specific Code • #ifdef _WIN32_WCE_EMULATION

  20. UNICODE Effects Unicode functions are the default: MessageBox macro interpreted as MessageBoxW Unicode data structures are the default: LOGFONT macro interpreted as LOGFONTW _UNICODE Effects Modifies tchar.h TCHAR is WCHAR LPTSTR is LPWSTR _tcscpy is wcscpy _T(“x”) is L”x” TEXT(“x”) is L”x” PreprocessorSymbols (continued)

  21. CompilerBuilding DLLs using C++ • An Include File: #include "MyLen.h" • The Source Code (MyLen.cpp): _declspec(dllexport) int _cdecl MyLen(char * p) { return 4; } • Resulting Exported Function: • ?MyLen@@YAHPAD@Z

  22. CompilerBuilding DLLs using C++ (cont) • Solution: // MyLen.H #ifdef _cplusplus extern "C" { #endif _declspec(dllexport) int _cdecl MyLen(char * p); #ifdef _cplusplus } #endif • Resulting Exported Function: • MyLen

  23. CompilerWin32 Message Cracker Macros • What They Are: • Macros to help build window procedures • One macro per Win32 message • Benefits of Using: • Make window procedures shorter • Correctly crack apart wParam & lParam • Correctly cast parameter values

  24. CompilerWin32 Message Cracker Macros (cont) • BEFORE: MyWindowProc(…) { switch (msg) { case WM_PAINT: <lots of code> break; case WM_MOUSEMOVE: <lots more code> break; default: DefWindowProc(hwnd, msg, . . .); }

  25. CompilerWin32 Message Cracker Macros (cont) • AFTER: MyWindowProc(…) { switch (msg) { HANDLE_MSG(hwnd,WM_PAINT,OnPaint); HANDLE_MSG(hwnd,WM_MOUSEMOVE,OnMove); . . . } void OnPaint(HWND hwnd) { /* WM_PAINT handling code */ } void OnSize(HWND hwnd,UINT state,int cx,int cy) { /* WM_SIZE handling code */ }

  26. CompilerWin32 Message Cracker Macros (cont) • The definitions: • #include <windowsx.h> • A Tool: Email: info@paulyao.com For a complimentary copy

  27. LinkerWhere is that function hiding? • Example: • Where to find "MailOpen", "MailPut", and "MailClose" • The Answer: msgstore.lib • How to solve that problem in the general case: C> dumpbin –linkermember:2 msgstore.lib>msgstore.dat C> dumpbin –linkermember:2 msmqrt.lib > msmqrt.dat

  28. Agenda – Part 3 / 3 • Highlights of eVC 4.0 • Tool Tips • TroubleShooting • Debugging via USB • Debugging via network at home • Debugging via network at work • Emulator set up • Adding Win32 DLLs to managed projects

  29. Debugging via USB/serial • Establish ActiveSync Partnership • Use latest version (3.6) • Select correct CPU (WCE Configuration Toolbar) • For best performance, hide Watch and Variables windows • Consider using network debugging…

  30. Debugging via networkAt 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]

  31. Debugging via networkAt Work (with DHCP) • Attach USB/serial cable • Enable DHCP on device • Attach network card/cable • Might need to reset device

  32. EmulatorTips for Setting 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

  33. Managed Code ProjectsAdding Win32 DLLs • In VS .NET Solution Explorer • Add->Add Existing Item • Set Build Action = “Content” • Example: • Add “Helper.dll” • Downloaded with executable

  34. Wrap-Up • eVC++ 4.0: • For custom devices & PocketPC 2003 • Sophisticated Tool set • Many ways to accomplish tasks • Email: info@paulyao.com • CRACKERS coding tool • CEFUN function viewer tool • Training / eCoaching for programmers

  35. Your Questions…

  36. Additional Resources • For the latest news and topics on Microsoft Pocket PC and Smartphone development: www.microsoft.com/mobile/developer • For detailed information on the .NET Compact Framework and Visual Studio .NET: mobility.microsoftdev.com • For detailed information on ASP.NET Mobile controls: www.asp.net/mobile • For detailed information on Tablet PC development: www.tabletpcdeveloper.com • To become a Microsoft Mobility Solutions partner: www.microsoft.com/mobile/partner • To learn how to decrease time to market: www.microsoft.com/mobile/mobile2market • For technical information and downloads: msdn.microsoft.com • Post-conference Mobility Developer Conference infowww.mymsevents.com • Market Smartphone and Pocket PC applications to mobile operators with Mobile2Market, visit www.microsoft.com/mobile/mobile2market

  37. Thank You!

More Related