CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 1999
    Location
    London , UK
    Posts
    22

    MDI program won't die

    I have an standard exe with an MDIform which calls both child and normal forms. The program uses an ActiveX .dll. The program does not quit after the unload event but the component terminates, what is wrong???????


  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: MDI program won't die

    When using multiple forms, when other forms (from the same program) are loaded and you close a form, the other forms remain active, and the app won't end. To overcome this, add the end command in the form_terminate event. Do this only on the 'main' form of your project, otherwise you might just end the program unwanted, but when the main form is closed, the app will end because it is told so by the form_terminate event.

    Tom Cannaerts
    [email protected]

    The best way to escape a problem, is to solve it.
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  3. #3
    Join Date
    Feb 2000
    Location
    Indiana
    Posts
    308

    Re: MDI program won't die

    In the Unload event of your main Window, loop through the forms collection and close all the other forms.


  4. #4
    Join Date
    Sep 1999
    Location
    London , UK
    Posts
    22

    Re: MDI program won't die

    This works, I overlooked the fact that forms must be treated like objects.

    Thanks


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

Featured