+ All Categories
Home > Documents > Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Date post: 15-Jan-2016
Category:
Upload: angel-ford
View: 214 times
Download: 0 times
Share this document with a friend
37
Developing Developing Applications Applications with eVC++ 4.0 with eVC++ 4.0 Paul Yao Paul Yao President President The Paul Yao Company The Paul Yao Company http:// http:// www.paulyao.com www.paulyao.com
Transcript
Page 1: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Developing ApplicationsDeveloping Applicationswith eVC++ 4.0with eVC++ 4.0

Paul YaoPaul YaoPresidentPresidentThe Paul Yao CompanyThe Paul Yao Companyhttp://http://www.paulyao.comwww.paulyao.com

Page 2: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

AgendaAgenda Highlights of eVC 4.0Highlights of eVC 4.0 Tool TipsTool Tips TroubleShootingTroubleShooting

Page 3: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Agenda – Part 1 / 3Agenda – Part 1 / 3 Highlights of eVC 4.0Highlights of eVC 4.0

What is eVC++ 4.0?What is eVC++ 4.0? Windows CE .NET EnhancementsWindows CE .NET Enhancements C++ EnhancementsC++ Enhancements The Right Tool…The Right Tool…

Tool TipsTool Tips TroubleShootingTroubleShooting

Page 4: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

What is eVC++ 4.0?What is eVC++ 4.0?

Stand-alone development environmentStand-alone development environment Supports C & C++Supports C & C++ Win32 API (.EXEs & .DLLs)Win32 API (.EXEs & .DLLs) Also MFC & ATL supportAlso MFC & ATL support ““Native” executablesNative” executables

Companion to Visual Studio .NET 2003Companion to Visual Studio .NET 2003 C# / VB .NETC# / VB .NET .NET Compact Framework.NET Compact Framework ““Managed” executablesManaged” executables

Page 5: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Windows CE .NET 4.1Windows CE .NET 4.1EnhancementsEnhancements Standard SDKStandard SDK Improved emulatorImproved emulator Kernel Independent Transport Layer (KITL)Kernel Independent Transport Layer (KITL) .NET Compact Framework.NET Compact Framework CECONFIG.HCECONFIG.H Shared source code (in Platform Builder)Shared source code (in Platform Builder) Added 32MB memory for XIP-DLLsAdded 32MB memory for XIP-DLLs Improved power managementImproved power management http://msdn.microsoft.com/msdnmag/issues/http://msdn.microsoft.com/msdnmag/issues/

02/07/default.aspx02/07/default.aspx

Page 6: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

C++ EnhancementsC++ Enhancements

C++ structured exception handlingC++ structured exception handling trytry catchcatch ThrowThrow

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

Page 7: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

The Right Tool…The Right Tool…

eVC++ 3.0eVC++ 3.0 Windows CE 3.0-Windows CE 3.0-

based smart based smart devicesdevices

Pocket PCPocket PC Pocket PC 2002Pocket PC 2002 Smartphone 2002Smartphone 2002

eVC++ 4.0eVC++ 4.0 Windows CE .NET-Windows CE .NET-

based smart based smart devicesdevices

Pocket PC 2003Pocket PC 2003

Ori Amiga
eVC4 SP2 is required for PPC "Ozone" and Next version of Smartphone.
Page 8: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Remote ToolsRemote ToolseVC++ 3.0 & eVC++ 4.0eVC++ 3.0 & eVC++ 4.0 Remote SPY++Remote SPY++ Remote Registry EditorRemote Registry Editor Remote Heap WalkerRemote Heap Walker Remote File ViewerRemote File Viewer Remote ZoominRemote Zoomin Remote Performance MonitorRemote Performance Monitor Remote System InformationRemote System Information

Page 9: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Remote ToolsRemote ToolsNew with eVC++ 4.0New with eVC++ 4.0 Remote Call ProfilerRemote Call Profiler

““Testing Real-Time Systems in Windows Testing Real-Time Systems in Windows CE .NET” by Mike Hall and Steve MailletCE .NET” by Mike Hall and Steve Maillet

http://windowsfordevices.deviceforge.cohttp://windowsfordevices.deviceforge.com/articles/AT2137345992.htmlm/articles/AT2137345992.html

Kernel TrackerKernel Tracker Graphical display of process, thread, Graphical display of process, thread,

scheduling, & synchronizationscheduling, & synchronization

Process ViewerProcess Viewer

Page 10: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Agenda – Part 2 / 3Agenda – Part 2 / 3 Highlights of eVC 4.0Highlights of eVC 4.0 Tool TipsTool Tips

IDE Keyboard ShortcutsIDE Keyboard Shortcuts PreprocessorPreprocessor CompilerCompiler LinkerLinker

TroubleShootingTroubleShooting

Page 11: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

IDE Keyboard ShortcutsIDE Keyboard Shortcuts

[F1] - Context Sensitive help[F1] - Context Sensitive help [F4] - [Next] (Error, Search result, etc.)[F4] - [Next] (Error, Search result, etc.) [F6] - [Next Window][F6] - [Next Window] [F9] - [Set Breakpoint] at cursor[F9] - [Set Breakpoint] at cursor [Tab] - Indent blocks of text[Tab] - Indent blocks of text [Ctrl] + [End] – Enable auto scroll for [Ctrl] + [End] – Enable auto scroll for

output windows (build, debug, find)output windows (build, debug, find)

Page 12: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

PreprocessorPreprocessorPrecompiled HeadersPrecompiled Headers Key Benefit - Faster Build timeKey Benefit - Faster Build time Obstacles:Obstacles:

Understanding SetupUnderstanding Setup Automatic versus ManualAutomatic versus Manual Establishing Default SettingsEstablishing Default Settings

Page 13: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Precompiled HeadersPrecompiled HeadersThree ModesThree Modes

Settings For: Settings For: All All ConfigurationsConfigurations

OffOff

AutoAuto

ManuaManuall

Page 14: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Precompiled HeadersPrecompiled HeadersThe Meaning of “Through header”The Meaning of “Through header”

#include "stdafx.h"#include "stdafx.h"#include "propsip.h"#include "propsip.h"#include <commctrl.h>#include <commctrl.h>#include <aygshell.h>#include <aygshell.h>#include <sipapi.h>#include <sipapi.h>

Use Use Precompiled Precompiled Headers Up Headers Up

to and to and including including stdafx.hstdafx.h

Page 15: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Precompiled HeadersPrecompiled HeadersSetup for Manual Mode (1 of 2)Setup for Manual Mode (1 of 2)

Select Source FileSelect Source File ““Create Create headers” headers” for one for one source source

filefile

Page 16: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Precompiled HeadersPrecompiled HeadersSetup for Manual Mode (2 of 2)Setup for Manual Mode (2 of 2)

Select Source FileSelect Source File

““Use Use headers” headers”

for all for all other other

source source filesfiles

Page 17: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Precompiled HeadersPrecompiled HeadersDefault SettingsDefault Settings

Select ProjectSelect Project

Sets Sets default default for new for new items items added added

to to projectproject

Page 18: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

PreprocessorPreprocessorSymbolsSymbols I486I486 WIN32WIN32 STRICTSTRICT USAUSA UNICODEUNICODE _UNICODE_UNICODE _X86__X86_ x86x86

UNDER_CE=$(CEVersion)UNDER_CE=$(CEVersion) _WIN32_WCE=$(CEVersion)_WIN32_WCE=$(CEVersion) _WIN32_WCE_EMULATION_WIN32_WCE_EMULATION INTLMSG_CODEPAGEINTLMSG_CODEPAGE INTERNATIONALINTERNATIONAL

Page 19: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

PreprocessorPreprocessorSymbols (continued)Symbols (continued) Windows CE Conditional CompilationWindows CE Conditional Compilation

#ifdef UNDER_CE#ifdef UNDER_CE Targeting a Specific VersionTargeting a Specific Version

#if UNDER_CE == 300#if UNDER_CE == 300 #if UNDER_CE >= 211#if UNDER_CE >= 211

Emulator-Specific CodeEmulator-Specific Code #ifdef _WIN32_WCE_EMULATION#ifdef _WIN32_WCE_EMULATION

Page 20: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

PreprocessorPreprocessorSymbols (continued)Symbols (continued)UNICODE EffectsUNICODE Effects Unicode functions Unicode functions

are the default:are the default: MessageBoxMessageBox macro macro

interpreted as interpreted as MessageBoxWMessageBoxW

Unicode data Unicode data structures are the structures are the default:default: LOGFONTLOGFONT macro macro

interpreted as interpreted as LOGFONTWLOGFONTW

_UNICODE _UNICODE EffectsEffects Modifies tchar.hModifies tchar.h TCHARTCHAR is is WCHARWCHAR LPTSTRLPTSTR is is LPWSTRLPWSTR _tcscpy_tcscpy is is wcscpywcscpy _T(“x”)_T(“x”) is is L”x”L”x” TEXT(“x”)TEXT(“x”) is is L”x”L”x”

Page 21: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

CompilerCompilerBuilding DLLs using C++Building DLLs using C++ An Include File:An Include File:

#include "MyLen.h"#include "MyLen.h"

The Source Code (MyLen.cpp):The Source Code (MyLen.cpp):_declspec(dllexport) int _cdecl _declspec(dllexport) int _cdecl

MyLen(char * p)MyLen(char * p)

{{

return 4;return 4;

}}

Resulting Exported Function:Resulting Exported Function: ?MyLen@@YAHPAD@Z?MyLen@@YAHPAD@Z

Page 22: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

CompilerCompilerBuilding DLLs using C++ (cont)Building DLLs using C++ (cont) Solution:Solution:

// MyLen.H// MyLen.H

#ifdef _cplusplus#ifdef _cplusplus

extern "C" {extern "C" {#endif#endif_declspec(dllexport) int _cdecl MyLen(char * p);_declspec(dllexport) int _cdecl MyLen(char * p);

#ifdef _cplusplus#ifdef _cplusplus

}}

#endif#endif

Resulting Exported Function: Resulting Exported Function: MyLenMyLen

Page 23: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

CompilerCompilerWin32 Message Cracker MacrosWin32 Message Cracker Macros What They Are:What They Are:

Macros to help build window proceduresMacros to help build window procedures One macro per Win32 messageOne macro per Win32 message

Benefits of Using:Benefits of Using: Make window procedures shorterMake window procedures shorter Correctly crack apart wParam & lParamCorrectly crack apart wParam & lParam Correctly cast parameter valuesCorrectly cast parameter values

Page 24: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

CompilerCompilerWin32 Message Cracker Macros (cont)Win32 Message Cracker Macros (cont) BEFORE:BEFORE:

MyWindowProc(…) {MyWindowProc(…) {

switch (msg) {switch (msg) {

case WM_PAINT:case WM_PAINT:

<lots of code><lots of code>

break;break;

case WM_MOUSEMOVE:case WM_MOUSEMOVE:

<lots more code><lots more code>

break;break;

default: default:

DefWindowProc(hwnd, msg, . . .);DefWindowProc(hwnd, msg, . . .);

}}

Page 25: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

CompilerCompilerWin32 Message Cracker Macros (cont)Win32 Message Cracker Macros (cont) AFTER:AFTER:

MyWindowProc(…) {MyWindowProc(…) {

switch (msg) {switch (msg) {

HANDLE_MSG(hwnd,WM_PAINT,OnPaint);HANDLE_MSG(hwnd,WM_PAINT,OnPaint);

HANDLE_MSG(hwnd,WM_MOUSEMOVE,OnMove);HANDLE_MSG(hwnd,WM_MOUSEMOVE,OnMove);

. . . }. . . }void OnPaint(HWND hwnd) {void OnPaint(HWND hwnd) {

/* WM_PAINT handling code *//* WM_PAINT handling code */

}}

void OnSize(HWND hwnd,UINT state,int cx,int cy) void OnSize(HWND hwnd,UINT state,int cx,int cy) {{

/* WM_SIZE handling code *//* WM_SIZE handling code */

}}

Page 26: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

CompilerCompilerWin32 Message Cracker Macros (cont)Win32 Message Cracker Macros (cont) The definitions:The definitions:

#include <windowsx.h>#include <windowsx.h>

A Tool:A Tool:

Email: Email: [email protected] a complimentary copyFor a complimentary copy

Page 27: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

LinkerLinkerWhere is that function hiding?Where is that function hiding? Example:Example:

Where to find "Where to find "MailOpenMailOpen", "", "MailPutMailPut", and ", and ""MailCloseMailClose""

The Answer: The Answer: msgstore.libmsgstore.lib

How to solve that problem in the How to solve that problem in the general case:general case:C> dumpbin –linkermember:2 msgstore.lib>msgstore.datC> dumpbin –linkermember:2 msgstore.lib>msgstore.dat

C> dumpbin –linkermember:2 msmqrt.lib > msmqrt.datC> dumpbin –linkermember:2 msmqrt.lib > msmqrt.dat

Page 28: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Agenda – Part 3 / 3Agenda – Part 3 / 3 Highlights of eVC 4.0Highlights of eVC 4.0 Tool TipsTool Tips TroubleShootingTroubleShooting

Debugging via USBDebugging via USB Debugging via network at homeDebugging via network at home Debugging via network at workDebugging via network at work Emulator set upEmulator set up Adding Win32 DLLs to managed projectsAdding Win32 DLLs to managed projects

Page 29: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Debugging via USB/serialDebugging via USB/serial

Establish ActiveSync PartnershipEstablish ActiveSync Partnership Use latest version (3.6)Use latest version (3.6)

Select correct CPU (WCE Configuration Select correct CPU (WCE Configuration Toolbar)Toolbar)

For best performance, hide Watch and For best performance, hide Watch and Variables windowsVariables windows

Consider using network debugging…Consider using network debugging…

Ori Amiga
just fyi... PPC Ozone, and Next version of Smartphone both require ActiveSync 3.7
Page 30: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Debugging via networkDebugging via networkAt Home (no DHCP)At Home (no DHCP) Establish partnership via Establish partnership via

USB/serialUSB/serial Static IP address on Static IP address on

desktopdesktop Static IP Address on Static IP Address on

smart devicesmart device Set WINS address to Set WINS address to

desktop IP addressdesktop IP address Start->Settings-> Start->Settings->

[Connections][Connections][Network] [Adapters][Network] [Adapters]<Select Adapter><Select Adapter>[Name Servers][Name Servers]

Page 31: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Debugging via networkDebugging via networkAt Work (with DHCP)At Work (with DHCP) Attach USB/serial cableAttach USB/serial cable Enable DHCP on deviceEnable DHCP on device Attach network card/cableAttach network card/cable Might need to reset deviceMight need to reset device

Page 32: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

EmulatorEmulatorTips for Setting UpTips for Setting Up Operating System:Operating System:

Use Win 2000 sp2, or WinXPUse Win 2000 sp2, or WinXP Cannot use Win 9x/MeCannot use Win 9x/Me

Communications:Communications: Requires TCP/IP (Internet) ProtocolRequires TCP/IP (Internet) Protocol Machine Name must start with letterMachine Name must start with letter

Tip:Tip: Login with Administrator privilegesLogin with Administrator privileges Install Microsoft Loopback AdapterInstall Microsoft Loopback Adapter

Ori Amiga
the emulator coming w/ SP2 also supports drive-mapping, and network VirtualSwitch
Page 33: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Managed Code ProjectsManaged Code ProjectsAdding Win32 DLLsAdding Win32 DLLs In VS .NET Solution In VS .NET Solution

ExplorerExplorer Add->Add Existing ItemAdd->Add Existing Item Set Build Action = Set Build Action =

“Content”“Content” Example:Example:

Add “Helper.dll”Add “Helper.dll” Downloaded with Downloaded with

executableexecutable

Page 34: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Wrap-UpWrap-Up

eVC++ 4.0:eVC++ 4.0: For custom devices & PocketPC 2003For custom devices & PocketPC 2003 Sophisticated Tool setSophisticated Tool set Many ways to accomplish tasksMany ways to accomplish tasks

Email: Email: [email protected]@paulyao.com CRACKERS coding toolCRACKERS coding tool CEFUN function viewer toolCEFUN function viewer tool Training / eCoaching for programmersTraining / eCoaching for programmers

Page 35: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Your Questions…Your Questions…

Page 36: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Additional ResourcesAdditional Resources For the latest news and topics on Microsoft Pocket PC and Smartphone For the latest news and topics on Microsoft Pocket PC and Smartphone

development: development: www.microsoft.com/mobile/developerwww.microsoft.com/mobile/developer For detailed information on the .NET Compact Framework and Visual For detailed information on the .NET Compact Framework and Visual

Studio .NET: Studio .NET: mobility.microsoftdev.commobility.microsoftdev.com For detailed information on ASP.NET Mobile controls: For detailed information on ASP.NET Mobile controls:

www.asp.net/mobilewww.asp.net/mobile For detailed information on Tablet PC development: For detailed information on Tablet PC development:

www.tabletpcdeveloper.comwww.tabletpcdeveloper.com To become a Microsoft Mobility Solutions partner: To become a Microsoft Mobility Solutions partner:

www.microsoft.com/mobile/partnerwww.microsoft.com/mobile/partner To learn how to decrease time to market: To learn how to decrease time to market:

www.microsoft.com/mobile/mobile2marketwww.microsoft.com/mobile/mobile2market For technical information and downloads: For technical information and downloads: msdn.microsoft.commsdn.microsoft.com Post-conference Mobility Developer Conference infoPost-conference Mobility Developer Conference info

www.mymsevents.comwww.mymsevents.com Market Smartphone and Pocket PC applications to mobile operators Market Smartphone and Pocket PC applications to mobile operators

with Mobile2Market, visit with Mobile2Market, visit www.microsoft.com/mobile/mobile2marketwww.microsoft.com/mobile/mobile2market

Page 37: Developing Applications with eVC++ 4.0 Paul Yao President The Paul Yao Company .

Thank You!Thank You!


Recommended