Nothing at all and Everything in general.

Visual Studio Free for Students, Discounted for ISVs

Last night a student asked me a question on how she could acquire the Expressions Suite software.  Being a student she can't afford to get it herself.  Her question reminded me of something I had known about but hasn't come to the front of my mind until now. Microsoft allows students to have free access to Expressions and Visual Studio 2008 Professional at no cost through the DreamSpark program. I had registered for the program while I was still a student so that I could tell other students of Southern Polytechnic State Univerisity how the program works. Having been reminded about the program I decided to bring it to attention one more time for any of you that may be students.

So what does this have to do with Windows Mobile?  If you wanted to begin programming with Windows Mobile there are two paths that you can take.  One is the path without Visual Studio.  It is not a path I would ever sugest unless you have no other option. The preferred path is to acquire a Professional version of Visual Studio.  But this path cost money in most cases.  If you are a student and would like to engage in Windows Mobile development you can take advantage of the DreamSpark program to go down this pathway without paying money (just remember to read the terms and conditions.  I believe software acquired this way cannot be used for commercial purposes).  If you are not a student and would still like to get your hands on Visual Studio Professional for experimenting then you can get it at a discount.  As described on the Windows Mobile Team Blog:


If you're concerned about the cost of Visual Studio Professional, you should consider joining the ISV Empower Program which is designed for Independent Software Vendors and provides limited Microsoft software licenses – including Visual Studio – for internal use, development and testing and technical support.  Registration with the program costs around $375 for companies in the United States.  Please consult https://empower-isv.one.microsoft.com/isv/Help/en/rsc.htm for a list of other countries which have an ISV Empower Program.

ISV Empower Program Overview : https://empower-isv.one.microsoft.com/isv/programguide/Default.aspx



Windows Mobile Rebranding

With the Mobile World Congress only a couple weeks away there's rumors galor about what will be announced.  Amongst the rumors are that Windows Mobile will be rebranded as Windows Phone. There's also to be a service available for syncing mail, contacts, and files called "My Phone" and word of a new reference design for Windows Mobile...I mean Windows Phones.  We will know with certainity whether or not these rumors were true in just a couple of weeks.

Resetting the Device

I was looking through the Windows Mobile Team Blog for something and came across a bit of code that I thought would be useful to some for resetting a device.  Here's the code:

extern static int KernelIoControl(
int dwIoControlCode,
  IntPtr lpInBuf,
int nInBufSize,
  IntPtr lpOutBuf,
int nOutBufSize ,
ref int



extern static void SetCleanRebootFlag();

 void HardReset()
bytesReturned = 0;
KernelIoControl(IOCTL_HAL_REBOOT, IntPtr.Zero, 0, IntPtr.Zero, 0, ref
bytesReturned );

Facebook Recognition

Some time ago I wrote a post about some things I would like to be able to do with Facial Recognition on the phone.  One of those things was integrating an application with Facebook so that in theory I'd be able to point my camera-phone at some one and immediatly get information on who the person is based on the person's face being matched against a facebook profile.  Last night I decided to do some looking around for facial recognition SDKs (developing my own would take to long).  I found a couple that looked suitable.

One was Okao from Omron. This company has done a lot of work with AI and machine recognition and is the company behind the face recognition in Apple's iPhoto in iLife 09. They have a version of their face recognition software that will work on Windows Mobile phones but there is no trial version available.  The other company I found was Neuto Technology.  Unlike Omron they have a Windows Mobile SDK that will work for 30 days.   The only component left would be something to look at Facebook Photographs.  I'll have to build a solution for iterating through the photographs.  But I'm sure most of the work of doing this will be reduced by making use of the  Microsoft Facebook Developer Kit.


I am begining to think this idea is actually possible!

Provoking Post

For any mobile operating system that you can name you can find some one that will point out what they feel to be a flaw in the operating System.  Mike  Calligaro of the Windows Embeded team knows this all to well.  If you read through the reader responses to many of his post you'll find a pletora of emotionally charged responses  For some of the responses I get the feeling the reader didn't actually read the entire post.  For others some readers make pretty good arguments. In either case I decided to collect what I thought to be the most interesting post addressing features of Windows Mobile that many have questioned.



Interesting Post


Quotes from Mike:


In response to "why can't you fix the damn bugs"

As much as I love the job, there are certainly frustrations as well. One of them is that more than half of the code on one of our phones is written by other people (OEMs, ISVs contracted by OEMs, ISVs contracted by Mobile Operators, etc) and any failing in any of that code is usually blamed on us.




Why Can't I Create a Smart Device Project?

So you've installed Visual Studio and you are ready to create a Smart Device project for your Windows Mobile device.  But when you go to create a new project the Smart Device templates are no where to be found.  Why is that?  Let's look at the possible causes for this problem. 

Is your Visual Studio Version an Express Edition?

Presently Microsoft doesn't have a version of Visual Studio Express that can be used to create smart device projects. If you are running an Express Edition of Visual Studio you will need to replace it with a professional version to develop for Windows Mobile. 

24 Hours of Windows Mobile : two thirds complete

As of today the "24 Hours of Windows Mobile" presentations are 2/3 complete.  I've been keeping track of the presentations.  If you would like to see any of them the links are below. 

Introduction to Windows Mobile Development 200 High level introduction to developing managed applications for mobile devices
Interoperability Between Native and Managed Code 300 Basic's of P/Invoke and using COM objects
Creating Adaptive Applications 300 Creating applications that work with a wide variety of formfactors
Using Pocket Outlook Data within a Managed Application 300 Retrieving and manipulating data stored within Pocket Outlook
Live Update from PDC 300 Sharing news announced at PDC time and other demonstrations
Developing Battery Friendly Applications for Windows Mobile 300 Demonstration of the State and Notifications broker and other features of Windows Mobile that can assist in developing applications that consume less power
Unit Testing for Mobile Devices 300 Explore using the unit testing functionality of Windows Mobile for devices
Testing Your Mobile Applications 300 Strategies for testing your Mobile Application
IPC and True Push 300 Asynchronous programming techniques inside your managed application
Windows Mobile Networking 300 Negotiating and establishing a network connection
Location Awareness 300 Location services available for Windows Mobile
Windows Mobile Power Toys 200 Tools to assist you in diagnosing information about your running applications.
App Dev with VS 2008 and SDK tools 300 what is new in the Microsoft .NET Compact Framework 3.5 and how to develop Windows Mobile client applications effectively.
Device Security 300 Explains how the Windows Mobile Security model works, and they show you how you can mimic device security using the emulator.
Tips for App Devs 300 Tips to improve your productivity in developing for Windows Mobile in Visual Studio.
Asynchronous Development Techniques 300 Learn how to properly start and terminate threads, update user interface controls inside multiple threads, and call Web services asynchronously.



Custom Actions in a Cab Installation

Creating a cab installer for a Windows Mobile program is easy.  After making a cab project you add your files and Visual Studio does everything else for you.  But when you uninstall your application what happens to all of the registry entries and data files that your application has made?  They get left behind unless you erase them yourself. Chances are your program won't ever receive any notification that it is about to be uninstalled, so your program won't be able to cleanup after itself.  Instead you will need to create a DLL that contains custom actions.   The installer build into the Windows Mobile device will call your DLL once before installation, once after installation, once before deinstallation, and right after deinstallation.  So how to you make this custom DLL?

The custom DLL will be a Win32 DLL smart device project. The DLL must define four functions, Install_Init, Install_Exit, Uninstall_Init, and Uninstall_Exit. To cleanup after your program has been uninstalled you will place cleanup code in Uninstall_Exit Here is the code for the custom actions DLL that I wrote. I've added code to clean up the registry.  If there are other programs that I've written still on the device they will be using the same registry hive to store their keys.  If other programs are found the program will leave behing the \HKCU\Software\J2i.Net key as not to accidentally erase the keys that my other programs use.  If there are no other programs found then J2i.Net will be removed.

DWORD ul_reason_for_call,
LPVOID lpReserved
switch (ul_reason_for_call)
return TRUE;
void RemoveRegistryKeys();
codeINSTALL_INIT Install_Init
HWND hWndParent,
BOOL fFirstCall,
BOOL fPreviouslyInstalled,
LPCSTR pszInstallDir
codeINSTALL_EXIT Install_Exit
HWND hWndParent,
LPCSTR pszInstallDir,
WORD cFailedDirs,
WORD cFailedRegKeys,
WORD cFailedRegVals,
WORD cFailedShortcuts
codeUNINSTALL_INIT Uninstall_Init
HWND hwndParent,
LPCSTR pszInstallDir
codeUNINSTALL_EXIT Uninstall_Exit
HWND hwndParent
void RemoveRegistryKeys()
HKEY hCompanyKey = NULL;
HKEY hSoftwareKey = NULL;
DWORD bufferSize = MAX_PATH;
bool canEraseCompanyKey = false;
//Delete the application key
RegOpenKeyEx(HKEY_CURRENT_USER,L"Software", 0,0,&hSoftwareKey);
RegOpenKeyEx(hSoftwareKey, L"J2i.Net",0,0,&hCompanyKey);
RegDeleteKey(hCompanyKey, L"MyColourPreferences");
canEraseCompanyKey = (ERROR_SUCCESS!=RegEnumKeyEx(hCompanyKey,0,buffer,&bufferSize,0,0,0,0));

To export the four functions the DLL will also need to contain a Module Definition file that exports the four functions. The contents of that file must look like the following.


That's all that needs to be in the DLL. When you create your installer you will need to add both the primary output of your program and this DLL to the project. The last thing that you need to do is change the CE Setup DLL setting on the CAB project. Select the CAB project from the Solutions Explorer and you will see the CE Setup DLL setting in the property editor. Click on the dropdown to the right of the setting and select Browse. Navigate to the native DLL that you created and your done. All you need to do is compile and build the CAB.

As an example there is a Visual Studio project attached to this entry.  The project contains a program of trivial simplicity.  All that you need to know about that program is that it will save the information you enter to the registry.  Without the custom action when you uninstall this program that information would be left in the registry.   But thanks to the custom action it will be removed.