Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Doesn't create Private DataSession
Message
From
28/10/2003 13:26:29
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00843481
Message ID:
00843663
Views:
16
>>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.

Yes, I have used AddProperty but that's not good solution. I have code in application that uses loop of Objects collection of Custom class, and when I used AddProperty Objects collection always stays empty, so I must find better solution.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform