Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Doesn't create Private DataSession
Message
 
 
À
28/10/2003 08:31:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00843481
Message ID:
00843532
Vues:
20
>I have main application class oApp (Container) which has a oForms class collection (oForms class is made of Custom class in which I add with AddObject() forms that I want).
>When I add Form class with Private DataSession to oApp.oForms new DataSession is not creating. It stays on Default(1) data session.
>
>Why? What is the problem? Why it doesn't create new DataSession?
>
>In Debugger I can see that Form property DataSession is set to 2, but DataSessionID = 1.

This is because you're using AddObject to add the forms to the Custom object. Child objects take the DataSession of their parent. If you, instead, use AddProperty, you should get your private datasessions.

Note:
If you choose to use the AddProperty technique, you will need to add clean-up code in your Custom.Destroy event to kill all the forms that have been "added" to it. Using AddProperty doesn't create a Parent-Child relationship so the internal cleanup doesn't take place. You have to manually do it.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform