Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to FREE resources (system resources) when loading & unloading instances of the same form?

Posted on 2000-02-21
8
Medium Priority
?
233 Views
Last Modified: 2010-04-16
Hi!

I am loading & unloading instances of the same form, but when I unload one of the form's instances (with "unload form1(x)" ...) nothing happends.

I searched through the MSDN and found some proposed answers (freeing resources) but that does NOT work.

Do you have an answer?


here is how I create those forms:

in module:
dim xxxx as form1

in code:

redim xxxx (1 to 200) as form1

then I show and close those forms.

THANX!

Igor.
0
Comment
Question by:kojot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 14

Expert Comment

by:mcrider
ID: 2545254
Try this:

In a MODULE:

     Global xxxx() As Form1

In Code:

     Redim xxxx(1 to 200) As Form1

Then to show the first form:

     Set xxxx(1) = New Form1
     xxxx(1).Show
     
To unload the first form:

     Unload xxxx(1)
     Set xxxx(1) = Nothing



Cheers!
0
 

Author Comment

by:kojot
ID: 2545677
I've allready tried that and it doesn't work. Resources just get lower and lower when I load a form I've unloaded before.

Thank you for your answer, but it doesn't work.


Igor.
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2546293
You tried the "Set xxxx(1) = Nothing"???

It works PERFECTLY on my system...
0
The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

 

Author Comment

by:kojot
ID: 2549170
Yes .. but nothing happend .. damn:) If you'd like I can send you my project and you can see for yourselve.

mail me at: maverick@maverick-int.si

Igor.
0
 
LVL 14

Accepted Solution

by:
mcrider earned 300 total points
ID: 2549330
That email address doesn't work...
0
 

Author Comment

by:kojot
ID: 2549523
What? OK .. maybe there are problems with servers .. put your email adress here and I'll send you  the code.

Igor.
0
 

Author Comment

by:kojot
ID: 2550000
Ok .. my fault .. an OCX was still active while i was trying to close the form. That worx. 10x!
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2552309
Thanks for the points. Glad I could help!


Cheers!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Simple Linear Regression

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question