Creating a New Project

Team-Fly    

 
eMbedded Visual Basic: Windows CE and Pocket PC Mobile Applications
By Chris Tacke, Timothy Bassett
Table of Contents
Chapter 1.  An Introduction to Windows CE


After you install eMbedded Visual Tools and the Pocket PC SDK, you're ready to start writing applications.

You first need to create a new project, which is done in the same basic way as with Visual Basic 6. You'll be prompted with the New Project dialog (see Figure 1.11) from which you'll have at least two types of projects from which to choose: Windows CE for the Pocket PC Project and Windows CE Formless project. If you've installed more SDKs, you'll have more options.

Figure 1.11. The New Project dialog with the Pocket PC template selected. Notice that I've also installed the HPC Pro and Palm- size PC SDKs.

graphics/01fig11.gif

The only difference between the Formless and the Pocket PC templates is that the Formless creates a project with a single module with the program entry point of Sub Main, whereas the Pocket PC project creates a project with a single form with the entry point at Form_Load. Either one can be converted to the other easily by adding either a form or module and changing the entry point.

Let's create a simple Hello World application so we can get a feel for some of the differences between eVB's IDE and Visual Basic's IDE.

Select the Pocket PC project template and click Open. You should see a familiar IDE screen. The only notable difference at this point from VB6 is that the form is all white (Pocket PC backgrounds are white instead of the Windows gray). You also have your familiar set of stock controls in the toolbox at the left.

Figure 1.12. The eVB IDE looks and feels just like Visual Basic 6. Notice, though, that the form is white instead of gray.

graphics/01fig12.gif

Next, go ahead and drop a single command button on the form, leaving its name Command1, and go to its Click event handler.

You'll probably notice that the code page already has a single method in it that looks like this:

 Private Sub Form_OKClick()     App.End End Sub 

The Pocket PC form has, by default, a small OK button in the upper-right corner where the desktop Windows Close button usually resides. This method gives the same functionality to the OK button by closing the application. You may rightfully wonder why it doesn't just have the End command; eVB doesn't support a global End command, instead it has an End method as part of the App object.

Now add the Command1_Click event handler, something like this:

 Private Sub Command1_Click()     MsgBox "Hello World!", vbExclamation, "My First App" End Sub 

Team-Fly    
Top
 


eMbedded Visual BasicR. WindowsR CE and Pocket PC Mobile Applications
eMbedded Visual BasicR. WindowsR CE and Pocket PC Mobile Applications
ISBN: N/A
EAN: N/A
Year: 2001
Pages: 108

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net