Running the Win32 Application To execute the application using the Windows Mobile Emulator, from the Menu select Debug Ô Start Without Debugging. This will bring up the Emulator as shown in Figure 2 and run your program to display the message “PCQ Hello World App”. Once you click 'OK', you will see the Windows Mobile 6 desktop – Figure 3.
Figure 4 New Project - MFC Application
Creating an MFC Project Start Visual Studio 2005 and select File Ô New Ô Project. The dialog box shown in Figure 4 will be displayed. Make the following selections and click 'OK': Project Type: Smart Device Templates: MFC Smart Device Application. You can change the following as per your requirements. In my case, the choices are: Name: PCQ_MFC_App Location: D:\Project Solution Name: PCQ_MFC_App Create directory for solution: Yes
This will start the MFC Smart Device Application Wizard. Click 'Next' to go to the Platforms page and follow the steps as given in the Win32 section for selecting the Windows Mobile 6 Professional SDK. Click 'Next' and follow steps given for each of the following dialog boxes:
This wizard will generate all necessary files and resources.
Modifying the Code for MFC Application Search for the function CPCQ_MFC_AppView::OnDraw() in the file PCQ_MFC_AppView.cpp and locate the following lines:
CPCQ_MFC_AppDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
Insert the following code after the 'TODO' comment line:
CString szText("PCQ Hello App - MFC"); CRect rect; rect.left = 20; rect.top = 30; rect.right = 150; rect.bottom = 50;
pDC->DrawTextW( szText, rect, 0);
From the Menu select Build Ô Build Solution. If everything has been done correctly, you will see the following message in the output box:
===== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped =====
Executing the MFC Application To execute the application using Windows Mobile Emulator, from the Menu select Debug Ô Start Without Debugging. This will bring up the Emulator as shown in Figure 5 and run your program to display the message “PCQ Hello App - MFC”.
Once you click the 'X' on the top right corner, you will see the Windows Mobile 6 desktop. You can explore the Windows Mobile 6 features such as Office Mobile. Click on Windows logo on the top left corner and select Office Mobile. Click on Excel Mobile and you'll see the screen as in Figure 6.
Note: Clicking on 'X', does not usually 'exit' the application. It just closes the application window. So, if you want a re-test, close the Emulator and run the application again.
Deploying applications on Windows Mobile devices The process of deploying applications on Windows Mobile devices requires the creation of a Cabinet (.cab) file. This CAB file can be installed through the Active Sync/Windows Mobile Device Center tools. The complete process is given online on the MSDN website. You can check the same at http://tinyurl.com/773zkp.
Conclusion Windows Mobile is being promoted heavily by Microsoft and various OEMs. The platform provides a very rich set of tools, APIs, libraries, frameworks and middleware, which is a subset of Microsoft technologies available on the Desktop. There is a large section of developers with a strong expertise in Microsoft technologies on Desktops, who can easily use the development tools, SDK and Emulator provided for Windows Mobile to learn the differences and create amazing applications for mobile devices running Windows Mobile 6.
This is an opportunity for developers to have a lot of fun while developing expertise at the same time in the fast growing mobile device arena. They can develop applications in their spare time and make them available for download through websites such as Download.com (http://www.download.com/ mobile/). They would get valuable feedback and if the application is a hit, they can make money too.
Get most out of your technology infrastructure investments with Dell
About CIOL | Media Kit | Site Map | Contact Us | Help | Write to us | Jobs@CyberMedia | Privacy Policy
Copyright © CyberMedia India Online Ltd. All rights reserved. Usage of content from web site is subject to Terms and Conditions.