310 likes | 481 Views
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
E N D
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 USER32.DLL MessageBoxA MessageBoxW MessageBoxW
UnicodeCompiler Support • ANSI characters and strings • ‘H’ • “Hello Unicode” • ==> Store as ‘char’ or ‘unsigned char’ • Unicode characters and strings • L’H’ • L”Hello Unicode” • ==> Store as ‘short’ or ‘unsigned short’ • Bi-modal (_UNICODE) • TEXT(‘H’) • TEXT(“Hello Unicode”)
UnicodeData Types • ANSI • CHAR – resolves to char • LPSTR – resolves to char * • Unicode • 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 *
UnicodeC-Runtime Functions • ANSI • strlen() – query length • strcpy() – copy string • strcat() – concatenate string • Unicode • wcslen() – query length • wcscpy() – copy string • wcscat() – concatenate string • Bi-Modal (_UNICODE) • _tcslen() – query length • _tcscpy() – copy string • _tcscat() – concatenate string
Functions mbstowcs – To Unicode ("Wide-character string") wcstombs – From Unicode Establish a clear boundary between Unicode and Non-Unicode Functions ? Unicode Conversion The Outside World ANSI Unicode ANSI Unclear boundary Clear boundary Unicode Windows CE
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 • Text, raster, vector output • Palettes • Printing (except on Palm size PC) • Multimedia • 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)
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 Supported
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 Kernel: Features Missing (*) Windows CE .NET supports this feature
Thread Quantum CeSetThreadQuantum Thread Priorities CeSetThreadPriority 256 priorities in Windows CE 3.0 CE Databases Installable Stream Drivers ActiveSync Power Management NKDbgPrintfW OutputDebugString wsprintf Kernel: Windows CE-Specific
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) Components
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 User-Interface
Features Supported Text Truetype fonts Raster DIBs Vector Printing DirectDraw Game API (GAPI) Features Missing Coordinate transformation Image Color Matching (ICM) Metafiles OpenGL (3-D library) Graphics
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 Connectivity
InternetFeatures Supported • Web Server • Active Server Pages Supported • Requires Platform Builder • XML Parser 2.5 • Pocket Internet Explorer • Internet Explorer for Windows CE
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 InternetWeb Browsers
Windows CE-SpecificFeatures • Power Management • Notifications • Databases • Desktop Connectivity • RAPI • ActiveSync • Command Bars • Installable User-Mode Drivers
Windows CE-SpecificFunctions and Messages • CreateFileForMapping • GetClipboardDataAlloc • GetKeyboardStatus • GetMessageSource • GetMouseMovePoints • Random • RegisterDevice • SHShowOutOfMemory • TransparentImage • WM_HIBERNATE
CEFUN.EXEA Free Utility • Queries • DLLs and Functions • Both Documented and Undocumented • Limits • No macros • No window classes • No COM interfaces • Available from • info@paulyao.com
Wrap-Up • Win32 API on Windows CE • “Greatest Hits” of Windows API • Share Source with Existing Windows Applications • Visit http://www.paulyao.com • 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! • 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” You can do this using your PocketPC, Laptop, PC or the CommNet machines in Hall J
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