Friday, March 25, 2011

Developing Simple Application on Windows Embedded CE 6.0

Hello,
Here is a simple application on Windows Embedded CE 6.0. Below contains the steps of creating the application, customizing it and testing it on the emulator. For those who are just beginning application development on Wince, this would be something you should try. So here it goes..

Before building a new Wince application you must have a built and tested (i.e. running) Device Emulator workspace. If you don't have it the follow this link.

Here we will take the example of a hello world application. The code is provided by Wince itself, so there is nothing much to do about writing the application. To start, first go to the solution explorer, subproject and right click on it. See below:


Click on Add New Sub-project, and you will get the following window:


Select WCE Application and give any name, as shown above. The following window will appear:


For a hello world application check the last radio button, as shown above. Then click on Finish. Now you will see the a new sub-project has been created under sub-project menu. See below:






To test this application directly, just right click on the application name, on the solution explorer and click Build. Then run the emulator to test the application. You should get something like this:

Well, that was really simple! It all happened in mouse clicks. Now its time to customize this application, put some buttons, create different windows etc.

To do anything on this application, first we need to understand the code. Once you are done with it, you can change the code confidently, without facing much problems.

The first customization would be changing the string "hello world!". If you search the source file, you will not find the string. So how does it get displayed? If you go through the code, you will come across a API CreateWindow which takes the second argument as the title. The title is defined in the resouce file (i.e. the '.rc' file). Hence to change this string, just change the title in the resource file.

For creating buttons and other stuff click here.

Cheers!!

No comments:

Post a Comment