PDA

Click to See Complete Forum and Search --> : Invisible non-modal form in ocx?


aelmeras
Dec 2nd, 2003, 01:40 PM
Hello,

I have a problem. I have an ocx that contains some classes like in a dll. A function call in one of these classes opens a non-modal form that stays visible while the function call returns. The form has a timer which does some job and eventually unloads the form. So far, so good.

Now I would like to make the form invisible. When I do this, the form gets terminated almost instantly. Is there a way to prevent this?

Jaiboy
Dec 2nd, 2003, 11:25 PM
Can you post your code.

-Jai

aelmeras
Dec 3rd, 2003, 02:37 PM
Here's a simplified example

Jaiboy
Dec 9th, 2003, 09:42 AM
Hi, Take the Rectified Code.

aelmeras
Dec 10th, 2003, 12:46 PM
Thank you for your reply. So if I understand it correctly, the problem is that I don't keep a reference to the object. But why is the object terminated when the form is invisible, while it is not terminated when the form is visible? Isn't it possible to keep an unreferenced object alive until you terminate it from the object itself?