>>Hi everybody,
>>
>>Looks like the trick of sharing data session between two forms doesn't work with class based forms.
>>
>>I set my child form DS to be default and I have this form as a class and call it through menu manager DoForm method. It uses default DS and not the parent form DS as I hoped.
>
>Now I understood what's up. Any object's code runs in the DS in which the object was created. If your menu manager creates your form, and menu manager is in DS 1, then your form's DS will also be 1.
>
>Now you can
>
>1- have DoForm as a .prg (i.e. DS-free) and have it just register your form in the Menu Mgr
>2- pass the DS number to the menu manager so it'd change to it before creating your form
>3- pass the DS number to the menu manager so it'd change the created form's datasessionID
>4- pass the caller form to the menu manager so it'd use its dataSessionID in either of the previous two ways
>5- have the caller form do (3) (which is, IIRC, what you're doing now)
Dragan,
I believe you correctly identified the cause of the problem. Now I guess I have to implement the solution 1 and change my project to use DoForm as a function and not a method of the menu.
If it's not broken, fix it until it is.
My Blog