>If anybody knows reasons that can prevent destroying private data session during form unloading? Form creates WinWord instance and fills word document.
>
>With regards, Vassili Medvedev
This reminds me of a situation with .CHM help files appearing 'behind' the active window when called due to the calling program not being 'connected' through the windows 'thread' - i.e., is it possible that the Word 'thread' is owned by some other thread than the form that is being unloaded and therefore it's object reference remains in memory/data session space??? In the .CHM example we had to explicity connect the .CHM window's thread (identified with its HWND handle) to the current windows 'thread' (HWND identified) utilizing the AttachThreadInput API. The reason it was 'unattached' in the first place was that the window we called/created the .CHM in was not the 'parent' window but a child 'thread'; therefore, the created .CHM thread did not recognize the current VFP active window as it was not the real 'parent' thread that created it. But only on certain versions of Windows...
I hate windows sometimes...