>>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)
It may be a good idea to re-write, because somehow the form manager doesn't let the form to be properly released. I see form's DS after it was closed. Instantiating the form object in the command window doesn't exibit the same problem. I tried to adapt the existing framework making only small modifications, but it's not that easy as it was supposed to be.
If it's not broken, fix it until it is.
My Blog