Microsoft KB Archive/314629

= FIX: Object Referenced by Property with ASSIGN Cannot Be Closed =

Article ID: 314629

Article Last Modified on 1/24/2002

-

APPLIES TO


 * Microsoft Visual FoxPro 7.0 Professional Edition

-



This article was previously published under Q314629



SYMPTOMS
A form or other class is created with a custom property which has an associated ASSIGN method. When the class is instantiated, and a reference to another object is assigned to the custom property, you are unable to release the second object, even if the first object no longer exists.



RESOLUTION
To resolve this problem, obtain the latest service pack for Visual FoxPro for Windows 7.0. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

316964 How to Obtain the Latest Visual FoxPro for Windows 7.0 Service Pack



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Visual FoxPro for Windows 7.0 Service Pack 1.



Steps to Reproduce Behavior
  Copy the following code to a new program and run it in Visual FoxPro 7.0: LOCAL loMyForm AS FORM, ; loCustClass AS CUSTOM

loCustClass = CREATEOBJECT(&quot;MyCustom&quot;) loMyForm = CREATEOBJECT(&quot;FORM&quot;) loCustClass.ofrm = loMyForm loMyForm.SHOW(1)

DEFINE CLASS MyCustom AS CUSTOM ofrm = .NULL.

PROCEDURE ofrm_assign LPARAMETERS vNewVal THIS.ofrm = m.vNewVal ENDPROC ENDDEFINE  When the form appears, try to close it by using the Close button; you are unable to do so. The only way to close the form is to issue a CLEAR ALL command from the Command Window.

NOTE: This problem only occurs if there is an ASSIGN method on the property holding the object reference (&quot;ofrm_assign&quot; in the example code).

Additional query words: close box kbVFP700sp1fix

Keywords: kbbug kbfix kboop kbvfp700fix KB314629

-

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

© Microsoft Corporation. All rights reserved.