Use of VARPTR$() On Objects or Their Properties Unpredictable

ID: Q92460


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0


SUMMARY

Using the function VARPTR$() to return the address of controls or their properties can yield unpredictable results, it may even cause your system to hang.

This behavior occurs because objects and their properties move around in memory. Microsoft has confirmed that this behavior is by design.


MORE INFORMATION

For example, the following steps will cause your system to hang:

  1. Start VBDOS.EXE.


  2. From the File menu select New Form... (Form1.FRM).


  3. Add a text box (Text1) to the Form (Form1).


  4. From the File menu select Exit, save all changes.


  5. Add the following code to the Form_Click event procedure:
    
           SUB Form_Click ()
               PRINT "X" + VARPTR$(Text1.Text)
           END SUB 


  6. Run the application. It hangs.


Do not use the function VARPTR$() on controls or their properties.

This information, as well as other information about Microsoft Visual Basic for MS-DOS, version 1.0, can be found in the file README.TXT that was installed along with the product.

Additional query words: VBmsdos 1.00

Keywords :
Version : MS-DOS:1.0
Platform : MS-DOS
Issue type :


Last Reviewed: December 3, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.