Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ActiveForm is different from _SCREEN and APPLICATION
Message
De
19/06/2002 18:59:36
 
 
À
19/06/2002 05:27:34
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00670049
Message ID:
00670354
Vues:
31
Vlad Grynchyshyn is right.
Also when run within the forms code
Application.ActiveForm = ThisForm
returns .F. but
_Screen.ActiveForm = ThisForm
returns .T.

According to me the safest way is to compare forms HWNDs (they are unique within Windows OS) e.g.
Application.ActiveForm.hwnd = _Screen.ActiveForm.hwnd

>Hi All,
>I run VFP7 SP1
>I found a problem with APPLICATION.ACTIVEFORM. Every of my forms Owns a Method GetSettings wich returns Settings in a Array
>
>If I run
>
>*make sure we have APPLICATION.ACTIVEFORM
>...
>loForm = APPLICATION.ACTIVEFORM
>loForm.GetSettings(@laSettings)
>...
>
>laSettings remains unchanged. If single step it, I can see the parameter changing in GetSettings but laSettings is not changed.
>
>If I catch an other reference to the form using SYS(2017) the Array is changed.
>
>If I compare loForm with the reference from sys(2017) it returns .f.
>
>But it is the same object!
>
>So I play arround and found finaly:
>*make sure we have _SCREEN.ACTIVEFORM
>...
>loForm = _SCREEN.ACTIVEFORM
>loForm.GetSettings(@laSettings)
>...
>
>
>it runs.
>
>If I compare loForm with the reference from sys(2017) now it returns .t. (as expected)
>
>So, where is the differnce between APPLICATION.ACTIVEFORM and _SCREEN.ACTIVEFORM?
>
>Any suggestion is welcome
>
>Agnes

Regards
Zlatin Zlatev,
MCSD (VS6)

Make solutions, not programs!

Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform