Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form object not released
Message
De
08/05/1997 08:08:08
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00031077
Message ID:
00031306
Vues:
54
>In my framework I also use the application object to launch a form, the method is LaunchForm(). I use a LOCAL vairable, but I also have a property of the application named oForm that is an object reference to the current form.
>
>I launch the form with;
>
> LOCAL loForm
> DO FORM Whatever WITH THIS NAME loForm
>
>There is more going on becuase I am using a array property to store all the forms that are open, but this is how I trck the current form.
>
>In the fomr class it receives the reference to the applciation in its Init;
>
> LPARAMETERS poCreator
> THISFORM.Creator = poCreator
>
>Creator is a custom property of the form class. In the form's Activate it calls;
>
> THISFORM.Creator.Register(THISFORM, THISFORM.Name)
>
>The register method of the application make the form the current form by;
>
> LPARAMETERS poForm, pcFormName
> THIS.oForm = poForm
>
>This one is really more complex because it searches the array property for the form name and handles getting the form in the array as well.
>
>Finally in the form's Destroy I;
>
> THISFORM.Creator.KillForm(THISFORM.Name)
>
>The KillForm method of the application will take the form out of the array and if the form is the current form it will NULL the oForm property.
>
>This removes the dependency on the non property variables for the form. The LaunchForm method can use the loForm variable until the form gets registered. Once the form is up and running I no longer need the variable because the oForm property points to the form.

Thanks, defining it local works in your case because it's a property of your application class. I might consider this technique when I'll have the time to adjust my framework. Thanks.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform