Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Using WinCE for Quality Inspections

0.00/5 (No votes)
28 May 2004 1  
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

   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:

    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:

    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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here