Results 1 to 3 of 3

Thread: Modifying form behavior in a multi-form app

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2001
    Posts
    36

    Modifying form behavior in a multi-form app

    I have a multi-form (non-MDI) app that I'm developing. When the user activates one of the forms in the app by clicking on it, all of the other forms in my app come to the top of the z-order. Is there any way to change this behavior? I would like to make it so that only the form that has been clicked comes to the foreground. I have tried to make an ActiveX .EXE with the thread per instance option out of the form that I'm creating multiple instances of, and this does create the effect that I'm looking for, but after creating 10 or 15 instances of the form, VB issues an "Out of memory" error.

    Any ideas?

    --Steve
    [email protected]

  2. #2
    jim mcnamara
    Guest
    10 or 15 instances of most complex ActiveX forms (controls) will blow memory. Put the ActiveX.EXE on a separate Server if you can. It may impact performance, but you do realize that the ActiveX component runs in it's own process space, separate from your app, consuming resources? Threading aggravates this.

    No human user can keep track of 10 different forms/windows all at once - find a way of retiring those controls that are out of focus. Persist them, set them to Nothing, and then rebuild them as needed. Don't keep extant references to them. Minmize idle windows - this helps paging of idle memory.

    The reason you are blowing memory is that referenced COM objects and associated memory cannot be swapped out, like what happens when an entire app is minimized. If you have 15 instances active, even if the windows are minimized, then they are ALL 15 in memory at once. None of them gets swapped out.

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2001
    Posts
    36
    Jim-

    Thanks for making things a little more clear about what's causing the memory problems with my ActiveX .EXE. As far as whittling down the number of forms on the screen - think of an app similar to a "Post-it" notes program, where you have many instances of a note on the screen at the same time. You have all of the notes on the screen, and when the user activates one by clicking on it, that note comes to the top of the zorder. All of the other notes on the screen should maintain their current zorder relative to all other open windows on the screen and relative to each other (with the exception of the note that the user just clicked on). As I said, I was able to accomplish this by creating an ActiveX .EXE, but with the memory problems that I described. So, as you said in your reply, I could retire the inactive notes somehow, then recreate them as needed...........I will have to do some thinking on a way to make this work.

    Thanks again for the reply!

    --Steve

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