Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2000-02-21
8
Medium Priority
?
238 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
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
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.
Loops Section Overview
Screencast - Getting to Know the Pipeline

885 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