Click here to Skip to main content
15,886,049 members
Articles / Mobile Apps / Windows Mobile

Using WinCE for Quality Inspections

Rate me:
Please Sign up or sign in to vote.
1.45/5 (11 votes)
28 May 2004CPOL3 min read 57.5K   255   14   8
A demonstration of what can be done using Windows CE.

InspectorCE Image

Introduction

This article details some of the pros-vs.-cons I found in learning Windows CE with VB.NET. By reading this article, I hope that you will get a better understanding of how easy it is to build a Quality Inspecting type application using the WinCE platform. Most of all, in this article, I hope to discuss just a few of the trials and overcomings of working with my first WinCE related application. At times, it was frustrating, but overall, it was fun working with the new language.

Background

This exercise, InspectorCE (i.e., ICE v1.0), actually began with me experimenting with ideas that would target the Windows CE platform. I've wanted to program using WinCE ever since Microsoft and CP have promoted the easy transition from Windows X .NET Framework over to WinCE framework. So, here is my progress thus far.

Using the code

Using the code is simple. Most of the programming took place using the deployment scheme built into Visual Studio .NET's Pocket PC 2002 Emulator. I have yet to test the setup and/or the application using an actual Windows CE powered device. So, with caution, I would urge you to give it a try and report back to let us know how it goes.

On startup, you are presented with the Home Screen interface for a Quality Inspection Visit. Once you have created a visit record, you go on to select detail information about Store Location, Owner's Name, Manager, etc...

Secondly, from the inspection sheet, you will score and rank the Store based upon individual criteria for the organization.

Finally, as an inspector, i.e. Consultant, you will choose to save, print, and or edit your inspection data. Once the data is saved, a (*.xml) file is created that can be uploaded and synchronized with the corporate database. This project will include the WebReference project to help on that front. It should be tweaked but I didn't have time to play around with it more.

First Point of Interest

VB
Private Sub btnNext1_Click(...) Handles btnNext1.Click
     Me.tabControl.SelectedIndex = 1
     CalculateTotals()
 End Sub

 Private Sub btnNext2_Click(...) Handles btnNext2.Click
     Me.tabControl.SelectedIndex = 2
     CalculateTotals()
 End Sub

 Private Sub btnNext3_Click(...) Handles btnNext3.Click
     Me.tabControl.SelectedIndex = 3
     CalculateTotals()
 End Sub

I wanted to show the above code to demonstrate just one of the dislikes I encountered. Usually, my code for these events would look something like this:

VB
Private Sub btnNext1_Click(...) _
Handles btnNext1.Click, _
    btnNext2.Click, btnNext3.Click
    Dim btn As Button = sender

    Select Case btn.Name
        Case btnNext1.Name
                ....
        Case btnNext2.Name
            ...
        Case btnNext3.Name
            ....
    End Select

End Sub

Notice how all of the logic code has been incorporated into ONE method syntax. Well, you can't do something as simple as this in WinCE because the Button control in WinCE does not have the Name attribute attached to it. Sounds ridiculous right? Well, I thought so too. Before I pulled out the rest of my hair trying to figure that one out, I just simply resorted back to the old VB6 method of writing individual methods for each button clicked. If anyone else out there knows of a better way, please let me know.

Second Point of Interest

Have any of you figured out how Windows CE forms are managed? I was taken back by errors whenever I tried to do simple open, close, form routines. For example, we can't do this:

VB
Private Sub miEditVisit_Click(...) Handles miEditVisit.Click
    Dim frm As New FrmVisits
    frm.ShowDialog()
    Me.Close() <--- This causes a NULLReference Exception Error
End Sub

I mean, yes it makes sense that the form does not exist anymore, but when, where, how, are they being called, loaded, and initialized? I may be going up the wrong tree here but I will definitely be looking that one up soon.

Final

Over all, I think that the experience gained here is great. But as a Newbie to Windows CE, prepare yourself for some small amount of frustration. Everything else once you get past that is pretty much the same as usual. You will have to get used to a smaller working screen area. But, that's were us great programmers get to become our greatest creative selves right?

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Founder Arkitech EBC Corporation
United States United States
MS, BBA, software developer, consultant, and trainer. Specializing in building data-centric applications designed for business, university, community & faith based organizations. Started developing Excel VBA macros and never looked back. Freelance developer utilizing VB.Net, SQL Server, Microsoft Access, and ASP.Net.

Comments and Discussions

 
Generalfor the Null Exception Pin
pashish14-Jun-06 18:35
pashish14-Jun-06 18:35 
Generalthe about us.. Pin
prozac8816-Aug-04 9:52
prozac8816-Aug-04 9:52 
GeneralRe: the about us.. Pin
Terence Wallace16-Aug-04 14:12
Terence Wallace16-Aug-04 14:12 
GeneralRe: the about us.. Pin
prozac8816-Aug-04 23:09
prozac8816-Aug-04 23:09 
GeneralRe: the about us.. Pin
Terence Wallace24-Aug-04 4:24
Terence Wallace24-Aug-04 4:24 
GeneralRe: the about us.. Pin
Terence Wallace8-Sep-04 16:04
Terence Wallace8-Sep-04 16:04 
GeneralNo image, no file. Pin
fifi30-May-04 5:07
fifi30-May-04 5:07 
GeneralRe: Updated... Pin
Terence Wallace30-May-04 19:43
Terence Wallace30-May-04 19:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.