Welcome to MSDN Blogs Sign in | Join | Help

MEDC 2005: Breakout 'Whats new in C++'

My 3rd session was “What’s new in C++” which has some great material even if it was a little dry in presentation style. I was discussing presentation style with a colleague during the break and we came to the conclusion that a presentation about code features, that has no actual demo’s of the code result is a very dry delivery although its possible to get through much more content. Writing the code rather than showing it would add quite a lot too this type of session but there is no way the same amount of material could be delivered. The sad fact remains that ‘presenting’ is at least 60% showmanship.

Here are the key points presented:

  • Notification Broker is a documented interface based around a feature previously only available to mobile operators in the Adaptation Kit. This interface is sooooo much nicer to use than the older one and makes lots of info available as a notification event either by sending a windows message or by launching an app following registration. RegistryNotifyWindow / RegistryNotifyApp are the API’s and the registration is persistent across boot. Some examples of notification values include: signal strength, change of IP address, next calendar appointment, Active Sync start | stop, date, display rotation, media player track changes, owner details changed etc. This is a major new feature, don’t underestimate how much more flexibility this provides for mobile apps!
  • Global sound settings are available through one API: SoundSetSound. Simplifies setting a ring tone and allows (PPC only) one API to reliably turn on and off the audio totally.
  • EDB (Embedded Database) is a much needed improvement on the very old CEDB. Windows Mobile 5.0 supports both, but looses some functionality specifically RAPI (Remote API) support for CEDB. EDB functions: just add an Ex or an Ex2 to the end of the old CEDB command. The docs that ship with the SDK at this time are wrong. There will be a refresh on the web soon that will correct lots of this stuff. These are two distinct technologies and there is no compatibility (or portability, or upgrade path) between the two databases. If you are using CEDB then now would be a good time to look at alternatives like EDB or SQL CE as I would imaging the Windows Mobile OS image cant support this duplicate functionality for ever!
  • SHLoadImageFile | Resource and IImageFactory / IImage support replace ImageDecomp. Loads php, jpg, bmp, gif etc.
  • POOM:
    • Custom property support – extend the list of properties to your hearts content!
    • Bulk property read, set support has been added
    • Notification via notification broker for most property changes + arrival of e-mail, contacts, calendar etc. Supports Add, remove, change.
  • GPS API: simplified, consistent interface used to wrap NMEA devices and allow GPS data to be shared with multiple apps. gpsapi.h is the header file. GPSOpenDevice, GPSGetPosition, GPSGetDeviceStatus…
  • Windows Mobile 5.0 implements DRM to the OMA standard v1.1. This is manifest in a simple file API to control access to protected files. Instead of using CreateFile to open a DRM protected file, use the FileDrmCreateFile and use all the same parameters. Also useful is the FileDrmVerifyRights to check the current user / device has permission to open the file or display a prompt to the user to purchase rights. FileDrmCommitRights must be called after a file has been viewed / read in order to maintain correct stats etc.
  • Finally we have a fully documented and simple way of doing mail stuff like:
    • starting an e-mail compose form using the MailCompose
    • Display a mail message from a POOM application with MailDisplay
    • Control inbox and display a new transport / folder with MailSwitchToFolder and MailSwitchToAccount
    • Force a message sync with MailSyncMessages
  • Smartphone gets the IME treatment, opening up to allow 3rd party IME apps. I would imaging there are very few people that care about this as most of us are happy with T9 or multitap on Smartphone. But if you have an idea or some radical hardware then this is really good news.
  • Close button: probably the most controversial UI aspect of PPC is the ‘Smart Minimize button’, that’s the little cross in the top right of the window. On every version of Windows Mobile prior to 5.0, pressing this button will move the current window to the back of the z-order and not actually close the application. The thinking behind this descision is that the device should operate more like a consumer electronic gadget rather than a general purpose OS – so make it simple but do the right thing for the user: appear to close the app, but make it really quick to start up again. Trouble is its often a royal pain in the ass for developers and power users when they press the X (smart minimize button) and the app doesn’t close so they haven’t freed up the memory or killed the app. Windows Mobile 5.0 adds the SHIDIF_CANCELBUTTON flag for SHInitDialog, and the SHDB_SHOWCANCEL option for SHDoneButton. This shows a X button top right, when pressed the app *does* close! Horah!
  • New Common Dialogs:
    • Picture Picker                           - GetOpenFileNameEx (CECamera)
    • Camera Capture Dialog            - SHCameraCapture. Always writes a .JPG file regardless of file name and extension.
    • Contacts                                   - ChooseContact. Can be customized for Phone, SMS, ect.
  • ExitWindowsEx provides clean reboot support on Pocket PC (already there on Smartphone).
  • Smartphone supports two state icons on the programmes list: deselected state and a selected state. This is supported by a reg key:
    • HKLM\MyTypeOrApp\default icon

@=myres.dll,-[ord]

o       HKLM\MyTypeOrApp\selected icon

@=myres.dll,-[ord]

  • Security:
    • QueryPolicy(ID, Out Value) can be called in the Normal code group on smartphone to discover what policies are in force.
    • GetDeviceUniqueID – can be called in the Normal code group to retrieve an encrypted version of the device key. Take the key name and bind with a hash of the app name. This gives the same value every time to the same app, so its as good as the device ID, but keeps the real ID hidden. Real device ID requires Trusted code group.

 

This was a very useful session, but it should have been less slide ware and more soft ware.

 

Marcus

 

 

 

 

 

Published Monday, May 16, 2005 8:51 AM by marcpe

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: MEDC 2005: Breakout 'Whats new in C++'

In this article, you mention "Smartphone gets the IME treatment, opening up to allow 3rd party IME apps".And i want develop my own IME on Smartphone 2003 or SE. My question is: Does Smartphone gets the IME before Mobile 5.0.
Thank you!
email: fzlbqiang@hotmail.com
Saturday, July 16, 2005 5:52 AM by lbq

# re: MEDC 2005: Breakout 'Whats new in C++'

Everywhere I am reading that it is posible to add customized property in POOM's Contact, but nowhere I am getting any clue about that. Can you please help me by imparting any idea (if possible, code snippet) about how to do that ?

Wednesday, May 23, 2007 2:58 AM by Shantanu

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker