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!!

Thursday, March 3, 2011

Building a Workspace for Device Emulator in Windows Embedded CE 6.0

Windows Embedded CE or WINCE 6.0 is a Real Time OS which can run on many hardware architectures. But in-case you are new to wince, you would prefer to build your newly installed OS on an emulator and test it.

For information about how to install wince 6.0 please click on the following link:
http://tech-stuff-home.blogspot.com/2011/03/how-to-download-and-install-windows.html

The following steps will guide you to build a binary image for ARMv4I Device Emulator, which is by default provided in wince 6.0 by Microsoft, and finally test it on your Desktop.

1. Creating a new Platform Builder project:

The first page when you run Microsoft Visual Studio 2005, will look something like this:


Now to create a new Platform Builder (i.e. wince) project, just go to File -> New -> Project and click on it; you will get the following screen:


Select Platform Builder for CE 6.0 and click on OS Design on the right hand side. Give a name like "Emulator". By default the location will be inside "drivename\WINCE600\OSDesigns". Just click Ok and in the following screen just give a Next. Then you will this window:


This window consists the set of Board Support Packages (BSP) which are currently installed in wince. Select the "Device Emulator: ARMV4I" BSP and press Next. The next window look somthing like this:


This window shows you the kind of device you are targeting. Just click on Industrial Device as shown and click Next. On you will get the following window:


Select Internet Appliance and press Next. On the following two windows there is nothing to worry about and Next. Finally a window will come saying OS Design Project Wizard Complete. Just press Finish to complete the process. You are almost done. A Catalog Item Notification window may come; just press acknowledge and you will get the following on your Visual Studio:





Now, you have successfully created a new Platform Builder project and your workspace is ready for building.

2. Building the Workspace:

There are two kinds of build you can do in wince -- Debug Build and Release Build. By default the mode is selected for Debug which will take a long time, so here is how to change to Release Build. On the top middle of the toolbar, there is a Solution Configuration Drop Down box, see below:




Select the Release Build option as shown above. Now its time to build. Go to Build and press Build Solution. See below:


It will take about 15 to 20 minutes to build, and finally you will see a success message; obviously if there are no errors. Now its time to test it.

3. Testing the built workspace:

For testing the new OS, go to Target -> Connectivity Options, see below:


Click on it and the following window will come. Just verify that you have the setting as shown below. If not, then use the drop down boxes to get these settings:


Once you have these settings, just click apply, then close and its ready. on the same Target tab click on the first option that is Attach Device you will get the following:


Once the download is complete, you will get Windows Embedded CE 6.0 running on your Desktop on a different window, well it may take some time! Here is the screen shot of wince 6.0 (you may get a smaller screen due to some settings:




Now that you have built a workspace successfully, you would like to write some application on it. For creating applications and more click here.

Please comment if you have any queries regarding this post!!

Wednesday, March 2, 2011

How to Download and Install Windows Embedded CE 6.0 Evaluation Version

Prerequisites for Installing Windows Embedded CE 6.0:
1. The PC must have Windows XP Service Pack 2 running.
2. Microsoft Visual Studio 8 IDE must be installed.
3. Make sure you have at least 10GB space in any drive, where Windows CE 6.0 will be installed.

The files required to download are:
1. Windows Embedded CE 6.0 Evaluation Version -- Setup.exe
2. Windows Embedded CE 6.0 Platform Builder Service Pack 1.msi
3. For Windows CE 6.0 R2 -- CE6R2.iso and setup.exe
4. For Windows CE 6.0 R3 -- CE6R3.iso and setup.exe

For Downloading Windows CE 6.0 click here. Then you can see the first setup.exe. Download it and then scroll down to find "What Others Are Downloading", there you can find steps 2, 3 and 4 to download. Download all the files mentioned above for complete installation. Keep the four parts of the download in four different folders for reducing confusion (you can name each folder steps 1 through 4).

Now after all these files are downloaded, its time to install Windows CE 6.0. Here are the steps:
1. Run the setup.exe of step1. This is to install Platform Builder. Installing wince is just like installing any other software on Windows XP. The only window which is to be understood is shown below:


This window shows the available BSPs and some wince components/code which can be installed. Make sure to include the Shared Source, which is marked as X. Also a list of BSPs are given as an option for installation. ARMv4I which is the BSP for Emulator, is by default marked as 'yes'. If required you can select any other also (eg. x86 or MIPS).

2. The second step of the installing process is to install the Platform Builder Service Pack. Just run the Windows Embedded CE 6.0 Platform Builder Service Pack 1.msi file and the rest is easy.

3. Third step is to install 'R2'. Since the ISO file is already downloaded, just run the setup file and follow the instructions and you are done.


4. Similarly, for the final step, i.e. installing 'R3', just run the setup and follow the instruction.


Hence, by following these simple steps your Windows Embedded CE 6.0 Real Time OS Evaluation Version is ready and configured for usage. Now you can develop real time applications and driver as per your requirement.


Please comment if you face any doubts..