Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling a form from a form... is this code ok ?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00477924
Message ID:
00477935
Vues:
24
Hi Gerard,

This all looks OK. The only thing you need to make sure that you assigned
ThisForm.oCallingForm = .NULL. before closing the form, so there will be no dangling reference.

>I am increasingly finding in my apps that I am calling a form from within another form, and am wondering is there any downside to the way I am doing it .
>I have seen references to 'dangling forms ' or 'dangling objects' but am not quite sure waht this means.
>
>I have a form (FormA) which Calls a form (FormB) and I am doing this as follows:
>
>1. In FormA I have a button which: Do Form FormB with This.Parent
> (This.Parent is it the parent of the click button .i.e. the Forma)
>
>2. In My FormB init I have a parameter and I store the called form to aproperty
> Init
> Parameters MyCalling Form
> This.oCallingForm = MyCallinForm
>
>3. This means that , inside in Formb I can access all proerties of FormA
> e.g. lcFormAcaption = ThisForm.oCallingForm.Caption etc.
>
>4. I close FORMB either as a Release Thisform or clicking on the 'X' of formb
>
>This all seems to work fine and I dont have any problems ..... but do I Have any leakage or dangling objecs hanging around afterwards... or maybe there is a better alternative ?
>
>regards,
>
>Gerard
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform