VBCE.com - The Premier Website For Visual Basic/CE Developers

 

*Dev Corner

Sample Code
Controls
Workarounds
Tips & Tricks
Q & A
Forums

*Goodies
Downloads
Software
Bookstore


*General
Home
What's New
General Info
Misc. Info


*News Worthy
News
Articles
Editorials
KB Articles
Reviews
Awards

*Miscellaneous
Web Links
Partners
Search
Feedback
Advertising

<% On Error Resume Next SiteStats() %>

Sponsors


More...


Questions and Answers

.

As this list of Questions and Answers grows longer, you may wish to use your web browsers Find function to search for items. If you have a question about VBCE, feel free to e-mail me.


images/q.gif (1221 bytes)Can the File control be used to access files on a network with a network card installed in my HPC?

images/a.gif (1110 bytes) Yes, Download the redirectors, install them, and reset your hpc!: Mips & SH3.


images/q.gif (1221 bytes)How do I determine my applications directory?

images/a.gif (1110 bytes)The directory of the application can be determined by the App Object, specifically for this question, the app.path property. Something to remember with Windows CE, an path to a file does not contain a drive specification, simply a backslash, like this: "\Windows\Startup.bmp" For a full sample of the App Object, see the Sample in the Code Section.


images/q.gif (1221 bytes)How do I do File Input and Output?

images/a.gif (1110 bytes)The beta version of the toolkit does not have any means for file I/O, but the released version of the toolkit includes a File Control and a File System control. The File Control is for reading and writing files, the File System Control is used for getting the attributes of files, and doing things like Dirs.


images/q.gif (1221 bytes)How do I call API's?

a.gif (1126 bytes)Well, you can't - VBCE 1.0 does not allow the calling of API's directly from VBCE code. To call an API you will need a control that calls the API for you. If you know C/C++, it's rather easy if you have VC 5.0 and the Visual C++ Toolkit for Windows CE.   Be sure to checkout the controls page for some free controls that you can use to call some of the more popular API calls.

VBCE 6.0 now supports calling API's.   Check out our sample code.  Be aware though, UDT's are not allowed, which makes certain API's impossible to call in VBCE.


images/q.gif (1221 bytes)How do I unload forms?

images/a.gif (1110 bytes)Well, you don't. In VBCE the best you can do is hide them.


images/q.gif (1221 bytes)How do I exit my application from code?

images/a.gif (1110 bytes)Use the App Object, the End method will exit the application. (App.End) The method will not show in the IDE because it is not a method of the VBA library, but it is a valid method of the VBScript runtime that VBCE uses.


images/q.gif (1221 bytes)I get the error "An error occurred when loading the startup form", what causes this?

images/a.gif (1110 bytes)Well, almost anything could cause this, but the most common cause is that the form contains controls that are registered for the desktop, but not the emulator or the device. Go to the Windows CE menu and choose Control Manager, ensure the control is installed in the proper locations.


images/q.gif (1221 bytes)Will VBCE operate on the Palm PC or the Auto PC?

images/a.gif (1110 bytes)No. VBCE 1.0 is only designed to work on Windows CE Handheld devices. The Palm PC and the Auto PC do not incorporate enough COM architecture to support VBCE.

Update (4/16/99) - Microsoft has announced support for PalmTop Development with the VBCE 6.0 toolkit - Check it out...


images/q.gif (1221 bytes)Why can't I customize the standard toolbar?

images/a.gif (1110 bytes)The Standard Toolbar cannot be customized in VBCE. This is so that the add-in can properly handle the menu and button events that it needs to.


 images/q.gif (1221 bytes)Why are some code errors not caught during compile time like regular Visual Basic?

images/a.gif (1110 bytes)VBCE uses the VBScipt runtime, by design, VBScript evaluates most code at runtime. Although this allows more errors to creep into code, most errors at runtime in VBCE to not end your application, even if the error is not trapped with an error handler.


images/q.gif (1221 bytes) I get an error "An error has occurred in the application", how do I debug this?

images/a.gif (1110 bytes)There are a number of different ways to debug this. Perhaps the best way is to put an On Error Resume Next statement in each procedure. Next, place the following line of code at the end of each procedure:

If Err.Number <> 0 then MsgBox "Error in MyProcName: " & _
  Err.Number & " " & Err.Description

Replace the word "MyProcName" with the procedure name. Now when the error occurs you know exactly which procedure is causing the error. Next, simply place message boxes in various locations in the procedure to find the offending line of code.

See also the article on Error Handling.


images/q.gif (1221 bytes)In the Project Properties dialog for a Windows CE project there is a textbox to specify the application help file. How do I call this help file?

images/a.gif (1110 bytes)Well, you don't directly from VBCE. There is no mechanism in VBCE to call help. (Help on Windows CE is HTML Help) Use one of the free controls listed on the controls page to shell to the Windows CE Help engine.


images/q.gif (1221 bytes)Why aren't message boxes modal?

images/a.gif (1110 bytes)That's a very good question. I suppose it's a leftover from the VBScript runtime that VBCE 1.0 was derived from. Use one of the controls listed on the controls page to display a modal message box or disable the form calling the message box while the message box is being shown, like this:

Form1.Enabled = False
MsgBox "Hello, this is a somewhat modal message box"
Form1.Enabled = True

The only drawback to this method is that if the user clicks on the forms button in the taskbar it will bring the form to the front, over the top of your message box.


images/q.gif (1221 bytes)Why can't I browse a bitmap into the Picture property of the PictureBox control?

images/a.gif (1110 bytes)The Windows CE operating system does not support the IPicture interface that VBCE needs to load the image from the frx file. You can type in the filename in the Picture property and it will be loaded at runtime. Like this "\windows\startup.bmp"


images/q.gif (1221 bytes)When I register a control on the emulator or the device I get a dialog that says it registered successfully, but it then gives an error code of 000000. Did an error really occur?

images/a.gif (1110 bytes)No, an error code of 00000000 means that there was no error. This is not a peculiar thing for VBCE, but for the Windows CE operating system.

Contents This Page:
    Network
    Access

    Application
    Path

    How to do
    File I/O

  Calling API's

  Unloading
    Forms

  Exiting the
    App

    Startup Error

   Palm PC/
    Auto PC

    Customize
    Toolbar

   Code Errors
    App Errors
    Help Files

   Modal
    MsgBoxes

    Picture
    Property

   Registering
    Controls

 
   

 

 

VBCE.com is DevX Winner!

Unless otherwise noted, all information on VBCE.com is Copyright 1998 - 2002
Windows, Windows CE, and Visual Basic are trademarks of the Microsoft Corporation.
VBCE.com is not responsible for content on external sites.
Send all feedback to webmaster@vbce.com
Webmasters - feel free to link to
VBCE.com - Premier Website for Visual Basic/CE Development

Buy Books!