Applications: Creating a simple UI application for Windows Mobile 6 using Visual Studio 2005: Part 1

Time to do some actual work. As the title suggests, I will be creating a simple UI application for windows mobile 6 professional device using visual studio 2005 and improve it step by step. I will cover the developments over maybe 2 or 3 posts and lets see how it goes.

Make sure you have installed Visual Studio 2005 and Windows Mobile 6 professional SDK before you proceed.

Note: When creating new smart device projects with VS2005 you might get a script failure error saying that the project creation failed, its a known issue and happens when you have IE7 or IE8 installed. Strangely, I have IE6 SP2 on my machine but the same error still showed up. Follow the instructions here to resolve the problem:

Open VS2005, select File->new->Project. The project wizard shows up. In "Project Types" select "Smart Device" under "Visual C++". On the right side select "Win32 Smart Device Project" and choose a name and location for this project. Lets call it "HelloWorld".

The project wizard now shows up asking you to select the platform and other project settings. Select "Next". Your Windows Mobile 6 professional sdk should show up on the list of installed sdk’s. Add this sdk to the "Selected SDK’s list" and lets remove "Pocket PC 2003" which will be selected by default. Click Next. The final page lets you select the type of your project and other options. Select "Windows Application" and leave the "Additional Options" and "Add support for" sections as is. Do not select "Empty Project" or "ATL" or "MFC". We will see how to go about creating an empty project in a later post. Click "Finish" and you are done. Source files and resource files which were automatically generated by the project wizard will now show up in solution explorer.

I prefer to work with "Windows Mobile 6 professional emulator" rather than the classic emulator. Basically, the classic emulator does not support phone functionality, you can see that the ‘Talk’ and ‘End’ buttons are not present. I will cover using the phone functionality in the emulator in later posts. So for now, just select the professional emulator. (With default settings, there should be a drop down list box on the top-left which enables you to select the type of emulator.)

Open stdafx.cpp and compile it (ctrl+F7). Open HelloWorld.cpp and compile. Now build the solution (F7). This should build our project without any errors. HelloWorld.exe should now be present under the debug folder in our project path. In my case it is: F:\MyProjects\HelloWorld\HelloWorld\Windows Mobile 6 Professional SDK (ARMV4I)\Debug->HelloWorld.exe

From the "Debug" menu select "Start Debugging", the emulator will now start and your application should deploy on it. This is how the application should look:

Application running on emulator

So there it is. A dumb application really. Let us add some functionality to it in the next post.

Part 2
Part 3

Leave a Reply

Your email address will not be published. Required fields are marked *