FAQ: Visual Basic Programming in Visual Basic 4.0

ID: Q142251


The information in this article applies to:


SUMMARY

This article covers some of the most Frequently Asked Questions (FAQs) about 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."


MORE INFORMATION

  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, such as integer or long.

    Other causes of this error are documented in the following Knowledge Base articles.

    Q129803 : Variable Coercion Rules in Visual Basic Version 4.0

    Q129709 : PRB: Overflow Error at Run Time w/Byte Type Counter in For Loop


  2. Q. How can you determine if a file exists on a drive?

    A. Use the Dir function. The Dir function returns the name of a file or directory that matches a specified pattern or file attribute or the volume label of a drive. For more information on the Dir function, query on "Dir" in the Visual Basic Online Help, or see the following article in the Microsoft Knowledge Base:

    Q112674 : How to Determine If a File Exists by Using DIR$


  3. Q. Now that I found the file, how do I delete it?

    A. Use the Kill statement. The Kill statement deletes the specified pathname and file from a disk. If you try to use the Kill statement to delete an open file, an error occurs. To delete directories, use the RmDir statement.

    For more information on the Kill statement, query on "Kill" in the Visual Basic Online Help.


  4. Q. I'm getting "Illegal Function Call." What's wrong?

    A. The following are some situations that can generate an Illegal
    
          Function call:
    
          CAUSE:      Function does not exist in the program.
          RESOLUTION: Make sure that the function exists in the program and
                      that the function is accessible to the form or procedure
                      calling the function. Place the function in a module to
                      allow access by any part of your program. Make sure that
                      the function name in the calling procedure matches the
                      name of the function.
    
          CAUSE:      Wrong number of parameters passed to the function.
          RESOLUTION: Check that the correct number of parameters is passed to
                      the function.
    
          CAUSE:      Wrong parameter type is passed to the function.
          RESOLUTION: Check that the parameter being passed to the function is
                      the type that the function expects. For example, passing
                      an integer parameter to a function expecting a string
                      results in this error.
    
          CAUSE:      Byte range for a character exceeded.
          RESOLUTION: Check that the byte value of a character is between 0 and
                      255. For example, if you add 50 to the extended-ASCII
                      character CHR(230) and assign it to a string in Visual
                      Basic, the result is an "Illegal function call" error.
     
    Another cause of this error is documented in the following Knowledge Base article:

    Q142937 : How to Prevent Multiple Instances of a VB Application


  5. Q. How can I be sure that all my forms are unloaded correctly?

    A. Use the following code in the Unload event of the form that has triggered your applications exit:
    
          Dim i as integer
          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...
          Unload Me
          End
     


  6. Q. Where are the corrections to the manuals listed?

    A. Get out your red pen and query the Knowledge Base using the "vb4win" and "kbdocerr" keywords for a list of documentation errors.


  7. Q. How do I make my Visual Basic program Windows 95 logo compliant?

    A. Request a pre-testing kit from the Windows Logo Department from the following sources:
    
          E-mail:   winlogo@microsoft.com
          Fax:      (206) 936-7329, Attn: Windows Logo Department
          Phone:    (206) 936-2880
          Mail:     Microsoft Corporation
                    Attn: Windows Logo Department
                    Bldg. 20
                    Redmond, WA 98052- 6399
     
    This kit provides all the information about requirements to display the Windows 95 logo on your program. For more information on the Windows Logo Program, see the following web site:

    http://www.microsoft.com/windows/winlogo/


Additional query words: 4.00 vb4win vb4all faq fax back


Keywords          : 
Version           : 
Platform          : NT WINDOWS 
Issue type        : 

Last Reviewed: June 3, 1999