Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object is not contained in a form
Message
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01653920
Message ID:
01653929
Views:
44
In order to resolve the issue I described in the initial post, I have to change how I instantiate MyClass2.

Instead:
thisform.oMyClass2 = NEWOBJECT( "MyClass2", "MyClass2Lib.VCX")
use:
thisform.NewObject( 'oMyClass2', "MyClass2", "MyClass2Lib.VCX")
Thank you, Thierry, for the solution.

My question now. The previous code (above/old approach) I would use Destroy method of the form to set the object oMyClass2 to .NULL.
If I change the code to the .NewObject, should I leave the code in the Destroy method? Or it may cause problems?

UPDATE. The existing code in the DESTROY method
thisform.oMyClass2 = .NULL.
causes error. So I see that I need to comment/remove it.

Which brings me to another question. When the form is released, will it "automatically" destroy the object oMyClass2? Or I may have a "hanging" reference?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform