The information in this article applies to:
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."
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 will etail more well-known causes of this error: Q100190 BUG: Overflow Error When CurrentX Or CurrentY Greater Than 32K Q81953 Overflow Error Plotting Points Far Outside Bounds of Control Q74517 FIX: Overflow Error If Print Long String to Form or Printer Q106495 BUG: VB Printer.Width/Height Values Incorrect for Plotter Q113439 PRB: Converting MBF to IEEE in Visual Basic for Windows Q95499 BUG: Stack Fault May Occur If Trapping Divide By Zero Q105808 BUG: Overflow in VB version 3.0 ICONWRKS Sample Program A. Get out your red pen and see the following article in the Microsoft Knowledge Base: Q100369 Corrections for Errors in Visual Basic Version 3.0 Manuals A. Here is a list of Knowledge Base articles that describe how "Illegal Function Call" (error #5) can be generated: Q113332 BUG: AddNew Method Gives Error: Illegal Function Call Q94778 BUG: Illegal function call / Division By Zero Errors Q88477 PRB: SetFocus During Form Load May Cause Illegal Function Call Q87773 PRB: SendKeys May Return Illegal Function Call Error Q84547 PRB: DateValue Argument Gives "Illegal Function Call" Error 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. 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: Q116058 Incorrect Popup Menu Events Fired with Invisible Menus 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. For additional information about creating a transparent bitmap from Visual Basic using Windows APIs, please see the following article in the Microsoft Knowledge Base: Q94961 How to Create a Transparent Bitmap Using Visual Basic 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: Q100369 Corrections for Errors in Visual Basic Version 3.0 Manuals 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: Q97136 BUG: OLE DataText Prop Doesn't Free Memory When Object Closed Q103438 BUG: Out of Memory w/ MSOLE2.VBX When SHARE.EXE Not Loaded Q107769 PRB: Out of Memory Error Using VB Outline Control Q113031 BUG: ActiveControl Property of Screen Object Loses Memory Q110989 BUG: Out of Memory Error When Adding 35-50 Pen Controls Q113031 BUG: ActiveControl Property of Screen Object Loses Memory Q102069 BUG: Out of Memory w/ Var Named ClientLeft/Top/Width/Height Q76983 BUG: FormName Not in Correct Order After Out of Memory Error 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: Q85978 Print Form or Client Area to Size on PostScript or PCL Printer A. You can use the following code in the unload event of the form that has triggered your applications exit:
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: Q112674 How to Determine If a File Exists by Using DIR$ SUMMARYAdditional query words:
Keywords : kbVBp300 kbDSupport |
Last Reviewed: July 20, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |