Microsoft KB Archive/92460

= Use of VARPTR$ On Objects or Their Properties Unpredictable =

PSS ID Number: 92460

Article Last Modified on 1/8/2003

-

The information in this article applies to:


 * Microsoft Visual Basic for MS-DOS 1.0

-



This article was previously published under Q92460



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:

 Start VBDOS.EXE. From the File menu select New Form... (Form1.FRM). Add a text box (Text1) to the Form (Form1). From the File menu select Exit, save all changes.  Add the following code to the Form_Click event procedure: SUB Form_Click PRINT &quot;X&quot; + VARPTR$(Text1.Text) END SUB  Run the application. It hangs.</ol>

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: KB92460

Technology: kbAudDeveloper kbVB100DOS kbVBSearch kbZNotKeyword3

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© 2004 Microsoft Corporation. All rights reserved.