Results 1 to 5 of 5

Thread: Invisible non-modal form in ocx?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2003
    Location
    The Netherlands
    Posts
    23

    Invisible non-modal form in ocx?

    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?

  2. #2
    Addicted Member
    Join Date
    Nov 2003
    Location
    India
    Posts
    227
    Can you post your code.

    -Jai
    See you,
    -Jai
    [Friends Never Say Good Bye]

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2003
    Location
    The Netherlands
    Posts
    23
    Here's a simplified example
    Attached Files Attached Files

  4. #4
    Addicted Member
    Join Date
    Nov 2003
    Location
    India
    Posts
    227

    The Solution

    Hi, Take the Rectified Code.
    Attached Files Attached Files
    See you,
    -Jai
    [Friends Never Say Good Bye]

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Sep 2003
    Location
    The Netherlands
    Posts
    23
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width