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.
Can the File control be used to access
files on a network with a network card installed in my HPC?
Yes, Download the redirectors, install them, and reset
your hpc!: Mips & SH3.
How do I determine my applications
directory?
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.
How do I do File Input and Output?
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.
How do I call API's?
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.
How do I unload forms?
Well, you don't. In VBCE the best you can do is hide them.
How do I exit my application from
code?
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.
I get the error "An error
occurred when loading the startup form", what causes this?
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.
Will VBCE operate on the Palm PC
or the Auto PC?
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...
Why can't I customize the
standard toolbar?
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.
Why are some code errors not caught during compile time like regular Visual
Basic?
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.
I get an error "An error has occurred in
the application", how do I debug this?
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.
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?
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.
Why aren't message boxes modal?
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.
Why can't I browse a bitmap into
the Picture property of the PictureBox control?
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"
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?
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.
|