Use the Latest Windows Mobile Technologies
4/19/2010
With each new version, Windows Mobile adds new features that improve on existing technologies. Deprecated features are supported in the current version, but may not continue to be in future versions. To help make sure that the application is compatible with future versions of Windows Mobile, use the newest Windows Mobile features in the application. This topic lists some new features and describes some improvements over previous technologies.
Loading Images
In the past, applications written in native code used imgdecmp.dll to load image files. This library has been deprecated. Applications should now use SHLoadImageFile to load an image file and SHLoadImageResource to load an image from a resource file. The following code shows you how to use these functions.
// Load an image from a file
HBITMAP hBmp = SHLoadImageFile(_T("image.jpg"));
// Load an image from a resource dll
HMODULE hMod = LoadLibrary(_T("images.dll"));
If(hMod != NULL)
{
HBITMAP hRsrcBmp = SHLoadImageResource(hMod, IDG_IMAGE);
}
These methods support GIF, JPEG, PNG, and BMP image formats.
Managed applications should use the System.Drawing.Bitmap class to load images.
Moving from GAPI to DirectX
Earlier versions of Windows Mobile provided the Gaming API, or GAPI, for game development. This library has been deprecated. New gaming and graphics applications should use the DirectX Mobile library. This library provides a hardware abstraction layer to enable applications to take advantage of devices that have accelerated graphics hardware. The APIs are familiar to developers of graphics and gaming applications for the desktop platform. Also, DirectX Mobile provides a managed code library.
The components of DirectX that are available with DirectX Mobile are DirectDraw, Direct3D Mobile, and DirectShow. For more information, see Graphics.
Changes to Outlook Mobile
Outlook Mobile has been updated from its earlier version and now offers improved performance. Outlook Mobile data is no longer stored in a CEDB database. This means that you can no longer obtain data from a database query. You can only access data through the Outlook Mobile APIs. For more information about how to write applications that use Outlook Mobile, see Pocket Outlook Object Model (POOM).
Outlook Mobile now exposes a set of command line arguments that you can use when you start the application by using the CreateProcess method. These command line arguments let you specify what view is displayed when the application starts. For example, the following command string starts Outlook Mobile and displays the Week view.
poutlook.exe calendar -vw
For more information about the new Outlook Mobile command line parameters, see Outlook Mobile Command Line Launch Parameters.
Changes to MAPI
The Messaging API, or MAPI, has added several new functions. MailComposeMessage provides a new way to start e-mail message composition inside an application. For information about this and other new MAPI functions, see MAPI Functions.
Updated Database Technology
Windows Mobile now exposes EDB as an in-ROM database framework for native applications. This replaces the CEDB database. EDB offers improved performance and reliability and exposes an API that is mostly compatible with the old CEDB API. EDB will be supported and improved in the future.
SQL Server Compact Edition is a new robust and scalable database solution for managed applications that is available for download. It replaces ADOCE, which is no longer available. SQL Server Compact Edition lets you write applications for mobile devices that share data with SQL Server and desktop applications.