Understanding Win32 Support in Pocket PC and Smartphone

Download Report

Transcript Understanding Win32 Support in Pocket PC and Smartphone

Understanding Win32
Support In Pocket PC And
Smartphone
Paul Yao
President
The Paul Yao Company
http://www.paulyao.com
Agenda








Design Goals
Character Set Support
Kernel
Components
User-Interface
Graphics
Connectivity
Internet
Windows CE Design Goals







Small
Portable
Configurable
Win32 Compatible
Development Tools
Well-Connected
Real-Time
General Principles




Unicode-Only
Focus on “Client-side” support
No Security
No “Frills”



Few helpers (ZeroMemory)
Cut Win16 functions
Leave one function when Win32 has 2+ ways
to do something


TextOut versus ExtTextOut
MoveToEx/LineTo versus Polyline
Windows NT Supports
Both Unicode And Ansi
APP.EXE
MessageBoxA
USER32.DLL
MessageBoxW
MessageBoxW
Unicode
Compiler Support

ANSI characters and strings




Unicode characters and strings




‘H’
“Hello Unicode”
==> Store as ‘char’ or ‘unsigned char’
L’H’
L”Hello Unicode”
==> Store as ‘short’ or ‘unsigned short’
Bi-modal (_UNICODE)


TEXT(‘H’)
TEXT(“Hello Unicode”)
Unicode
Data Types

ANSI



Unicode



CHAR – resolves to char
LPSTR – resolves to char *
WCHAR – resolves to unsigned short
LPWSTR – resolves to unsigned short *
Bi-Modal (_UNICODE)


TCHAR – resolves to char or
unsigned short
LPTSTR – resolves to char *
or unsigned short *
Unicode
C-Runtime Functions

ANSI




Unicode




strlen() – query length
strcpy() – copy string
strcat() – concatenate string
wcslen() – query length
wcscpy() – copy string
wcscat() – concatenate string
Bi-Modal (_UNICODE)



_tcslen() – query length
_tcscpy() – copy string
_tcscat() – concatenate string
Unicode Conversion

Functions



mbstowcs – To Unicode ("Wide-character string")
wcstombs – From Unicode
Establish a clear boundary between Unicode and
Non-Unicode Functions
The Outside World
Clear
boundary
ANSI
Unclear
boundary
?
Unicode
Windows CE
ANSI
Unicode
COREDLL.DLL


Has 1600+ Functions
KERNEL





Processes and Threads
Synchronization objects
Memory and File mapping
Object Store – files, registry, databases
USER



Windows, menus
Dialog boxes, property sheets
Cursors, carets
COREDLL.DLL

GDI




Multimedia



Text, raster, vector output
Palettes
Printing (except on Palm size PC)
Audio Compression Mgr (AcmDriverID)
Sound (sndPlaySoundW)
Encryption API (CryptEncrypt)
COREDLL.DLL






C-Runtime Functions
Remote Access Services (RAS)
TAPI (lineOpen)
Localization Support (GetTimeFormat)
Windows Networking (WNet… APIs)
CE-Specific APIs


Databases (CeOpenDatabase)
Notifications (CeRunAppAtTime)
Kernel: Features Supported




Processes
Threads
Synchronization
Objects
Memory




Dynamic Shared
sections
Static shared
sections
Memory mapped files
Thread local storage

Win32 Exceptions









__try
__except
__finally
__leave
Dynamic Link
Libraries
File I/O
Long File Names
Registry
Clipboard
Kernel: Features Missing



Fibers (*)
.INI file Access
C++ Exceptions (*)






try
throw
catch
Win16 Registry
Functions
GlobalAlloc
Atoms



Dynamic Data
Exchange (DDE)
Object Linking and
Embedding (OLE)
WaitForMultipleObjects


bWaitAll must be FALSE
NT-Style Services
(*) Windows CE .NET supports this feature
Kernel: Windows CE-Specific

Thread Quantum





CeSetThreadQuantum 
Thread Priorities


CeSetThreadPriority
256 priorities in
Windows CE 3.0
CE Databases
Installable Stream
Drivers

ActiveSync
Power Management
NKDbgPrintfW


OutputDebugString
wsprintf
Components

Features Supported

Component Object
Model (COM)





In-Process Servers
Local Servers
Distributed COM
(DCOM)
Automation
ActiveX Template
Library (ATL)

Features Missing



COM+
MTS
MSMQ Queued
Components (COM
object integration)
User-Interface

Features Supported







Windows
Subclassing
Dialog Boxes
Common Dialog
Boxes
Common Controls
Cursors
Carets

Features Missing

Pure Menus





Use “command bars”
instead
Some Common
Dialogs
Some Common
Controls
Property Sheet
Wizards
Hooks
Graphics

Features Supported

Text






Features Missing

Truetype fonts
Raster



DIBs
Vector
Printing
DirectDraw
Game API (GAPI)


Coordinate
transformation
Image Color
Matching (ICM)
Metafiles
OpenGL (3-D library)
Connectivity

Features Supported






Windows Sockets
API (winsock)
Internet Helper API
WinInet API
Telephony API
(TAPI 2.1)
Microsoft Message
Queue (MSMQ)
Message API (MAPI)

Features Missing

Asynchronous
sockets
Internet
Features Supported

Web Server





Active Server Pages Supported
Requires Platform Builder
XML Parser 2.5
Pocket Internet Explorer
Internet Explorer for Windows CE
Internet
Web Browsers

Pocket Internet Explorer



HTML 3.2
Size (x86): 1.3MB
Runs On: PocketPC,
Embedded Devices

Internet Explorer for
Windows CE









HTML 4.0
Frames
Cascading Style Sheet (CSS)
Dynamic HTML
ActiveX Controls
Java Applets
Size (x86): 3.1MB
Runs On: Custom
Embedded Devices
Lacks


Client-side data binding
VBScript Support
Windows CE-Specific
Features




Power Management
Notifications
Databases
Desktop Connectivity




RAPI
ActiveSync
Command Bars
Installable User-Mode Drivers
Windows CE-Specific
Functions and Messages










CreateFileForMapping
GetClipboardDataAlloc
GetKeyboardStatus
GetMessageSource
GetMouseMovePoints
Random
RegisterDevice
SHShowOutOfMemory
TransparentImage
WM_HIBERNATE
CEFUN.EXE
A Free Utility

Queries



Limits




DLLs and Functions
Both Documented and
Undocumented
No macros
No window classes
No COM interfaces
Available from

[email protected]
Wrap-Up

Win32 API on Windows CE



Visit http://www.paulyao.com



“Greatest Hits” of Windows API
Share Source with Existing Windows
Applications
CEFUN function viewer tool
Info on Windows CE training classes
Resources


http://www.egroups.com/community/
windowsce-dev – Great community
http://www.pocketpc.com – Good Tips
Remember To Fill Out
This Session’s Evaluation!
You can do this using your PocketPC, Laptop,
PC or the CommNet machines in Hall J

To access the evals you must be logged into
mymsevents.com



Go to – http://www.mymsevents.com/MyMSEvents/
mobile/Survey/SurveySelect.aspx – mobile
http://www.mymsevents.com/MyMSEvents/
Survey/SurveySelect.aspx – web site
For more detailed information about filling out
evaluations please refer to either the Conference
Guide or the CommNet under “Evaluations”
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 info
www.mymsevents.com
Market Smartphone and Pocket PC applications to mobile operators
with Mobile2Market, visit www.microsoft.com/mobile/mobile2market
Discussion
Thank You!