FAQ: VB Programming in VB 3.0Last reviewed: August 25, 1997Article ID: Q126731 |
|
3.00
WINDOWS
kbrpg kbfaq
The information in this article applies to: - Standard and Professional Editions of Microsoft Visual Basic for Windows, version 3.0 This article covers some of the most Frequently Asked Questions (FAQ) about non-technical issues for Microsoft Visual Basic for Windows. You can find this and other FAQ articles by querying on the keyword "FAQ." You can find additional general references in the Microsoft Knowledge Base by searching on "article list." 1. Q. I'm getting error #6 "Overflow." What's wrong?
A. The most common cause of an overflow error is exceeding the upper or
lower bounds of either the type of a data variable or the limits of
the property for an object.
Query on "Data Types" in the Visual Basic online Help to determine
the upper and lower bounds for various data types (integer, long,
and so forth).
Additionally, the following detail more well-known causes of this
error:
ARTICLE-ID: Q100190
TITLE : BUG: Overflow Error When CurrentX Or CurrentY Greater
Than 32K
ARTICLE-ID: Q81953
TITLE : Overflow Error Plotting Points Far Outside Bounds of
Control
ARTICLE-ID: Q74517
TITLE : FIX: Overflow Error If Print Long String to Form or
Printer
ARTICLE-ID: Q106495
TITLE : BUG: VB Printer.Width/Height Values Incorrect for Plotter
ARTICLE-ID: Q113439
TITLE : PRB: Converting MBF to IEEE in Visual Basic for Windows
ARTICLE-ID: Q95499
TITLE : BUG: Stack Fault May Occur If Trapping Divide By Zero
ARTICLE-ID: Q105808
TITLE : BUG: Overflow in VB version 3.0 ICONWRKS Sample Program
2. Q. Where are the corrections to the manuals listed?
A. Get out your red pen and see the following article in the
Microsoft Knowledge Base:
ARTICLE-ID: Q100369
TITLE : Corrections for Errors in Visual Basic Version 3.0
Manuals
3. Q. How do you tell if a file exists?
A. Use the DIR$ function.
4. Q. Now that I found the file, how do I delete it?
A. Use the KILL$ function.
5. Q. I'm getting "Illegal Function Call." What's wrong?
A. Here is a list of Knowledge Base articles that describe how "Illegal
Function Call" (error #5) can be generated:
ARTICLE-ID: Q113332
TITLE : BUG: AddNew Method Gives Error: Illegal Function Call
ARTICLE-ID: Q94778
TITLE : BUG: Illegal function call / Division By Zero Errors
ARTICLE-ID: Q88477
TITLE : PRB: SetFocus During Form Load May Cause Illegal Function
Call
ARTICLE-ID: Q87773
TITLE : PRB: SendKeys May Return Illegal Function Call Error
ARTICLE-ID: Q84547
TITLE : PRB: DateValue Argument Gives "Illegal Function Call"
Error
ARTICLE-ID: Q77393
TITLE : BUG: DateSerial Does Not Give Error for Invalid Month or
Day
Additionally, don't exceed the byte value range of 0 to 255 when
dealing with characters. For example, if you add 50 to the extended-
ASCII character CHR$(230) and assign it to a string in Basic, you get
an "Illegal function call" error.
6. Q. If I have invisible menus on my form, why do the wrong menus appear
when I choose a pop-up menu?
A. Visual Basic is not firing the correct menu choice on a pop-up menu
for a menu whose visible property is set to False. This has been
confirmed to be a bug in Visual Basic 3.0.
To work around this problem, either:
- Make the first menu on the form visible.
-or-
- Place all pop-up menus on a separate form. Then you can leave all
the menus on your pop-up menus visible, but make the form that
contains them invisible. To make the form invisible, set the
form's visible property to false. You can invoke pop-up menus from
other forms by referring to the form name and then the menu name,
as in this example:
PopupMenu Form2.Menu2
For additional information, please see the following article in
the Microsoft Knowledge Base:
ARTICLE-ID: Q116058
TITLE : Incorrect Popup Menu Events Fired with Invisible Menus
7. Q. How can I create a transparent bitmap, or layer multiple bitmaps on
top of each other?
A. If bitmaps are layered on top of one another, the overlapped regions
will not show through the bitmaps that are on top unless the upper
bitmap has transparent regions. Article Q94961 shows how to create a
transparent bitmap from Visual Basic using Windows APIs.
For additional information, please see the following article in
the Microsoft Knowledge Base:
ARTICLE-ID: Q94961
TITLE : How to Create a Transparent Bitmap Using Visual Basic
8. Q. How can I find out what corrections have been made to the Visual
Basic manuals?
A. As the errors are found and reported, they are gathered together into
article Q100369 in the Knowledge Base.
For additional information, please see the following article in
the Microsoft Knowledge Base:
ARTICLE-ID: Q100369
TITLE : Corrections for Errors in Visual Basic Version 3.0
Manuals
9. Q. I'm getting "Out of Memory" and my machine has XX megabytes free,
what's wrong?
A. "Out of Memory" is typically one of two problems. First, you may have
exceeded the limits of one of Visual Basic's internal 64K tables.
Second, "Out of Memory" seems to be a catchall error for other, less
specific problems.
To prevent legitimate "Out of Memory" messages consult with Appendix
D (Specifications and Limitations) and Chapter 11 (Optimizing Your
Application for Size and Speed) in the "Programmer's Guide." Then
consult article Q112860 (General Memory Management in Visual Basic
Vers 3.0 for Windows), which was written in conjunction with the
developer who implemented VB's memory management, and discusses how
to deal with this issue.
For the other case, consult the following Knowledge Base articles as
known sources of the "Out of Memory" error when the cause may not be
an actual memory leak.
For additional information, please see the following articles in
the Microsoft Knowledge Base:
ARTICLE-ID: Q97136
TITLE : BUG: OLE DataText Prop Doesn't Free Memory When Object
Closed
ARTICLE-ID: Q103438
TITLE : BUG: Out of Memory w/ MSOLE2.VBX When SHARE.EXE Not
Loaded
ARTICLE-ID: Q107769
TITLE : PRB: Out of Memory Error Using VB Outline Control
ARTICLE-ID: Q113031
TITLE : BUG: ActiveControl Property of Screen Object Loses Memory
ARTICLE-ID: Q110989
TITLE : BUG: Out of Memory Error When Adding 35-50 Pen Controls
ARTICLE-ID: Q113031
TITLE : BUG: ActiveControl Property of Screen Object Loses Memory
ARTICLE-ID: Q102069
TITLE : BUG: Out of Memory w/ Var Named
ClientLeft/Top/Width/Height
ARTICLE-ID: Q76983
TITLE : BUG: FormName Not in Correct Order After Out of Memory
Error
10. Q. How do I capture/print a picture control with embedded controls and
graphics?
A. Article Q85978 offers a very handy routine called PrintWindow(). In
the context of the article, PrintWindow() is used to print a form's
client area to a printer. However PrintWindow() does not really care
much about the source of the image or the destination. All it
requires is a hWnd (window handle) property from the source, and a
hDC (device context) and the ability to receive a bitmap for the
destination.
Therefore, you can use PrintWindow() to capture an image of a
picture control with embedded controls and graphics into either a
printer object, or to another picture control.
For additional information, please see the following article in
the Microsoft Knowledge Base:
ARTICLE-ID: Q85978
TITLE : Print Form or Client Area to Size on PostScript or PCL
Printer
11. Q. How can I be sure that all my forms are unloaded correctly?
A. You can use the following code in the unload event of the form that
has triggered your applications exit.
Dim i%
While forms.Count > 1
' Find first form besides "me" to unload
i% = 0
While forms(i%).Caption = Me.Caption
i% = i% + 1
Wend
Unload forms(i%)
Wend
' Last thing to be done...
End
12. Q. How do I make my Visual Basic app Windows '95 logo compliant?
A. A difficult task prior to Win '95 shipping, but there are some
things you can do to move into the right direction. The Microsoft
Windows logo department has prepared a mailing on the Windows logo
transition. You may access this document by calling the faxback
service at (800) 426-9400. Choose option 2 for Developer Solutions,
then option 1 for the faxback service, then press 1 for a complete
index of available documents. Or choose document #130 for specific
information on the Windows '95 logo program.
13. Q. How do I make my Visual Basic app Office-compatible?
A. This is a program that is available to Independent Software Vendors.
You can call to find out what is required by ordering the Microsoft
Office Compatible Information Kit (Order Part Number 098-55847) at
(800) 426-9400.
A. Article Q112674 shows how do check if a file exists by using the DIR$ command. For additional information, please see the following article in the Microsoft Knowledge Base: ARTICLE-ID: Q112674 TITLE : How to Determine If a File Exists by Using DIR$ |
Additional reference words: 3.00 fax back FAQ
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |