Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Doesn't create Private DataSession
Message
 
 
To
28/10/2003 08:31:50
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00843481
Message ID:
00843532
Views:
19
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform