For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > April 2004 > Free Memory









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Free Memory
Mourad DJEBLI

2004-04-28, 12:32 pm

Hi, All,

I work with VB6, and ActiveX
So I note that the memory doesn't free when the form ou usercontrol is
unloaded, and so the ammount of memory that my program use increase
each time I launch my form.

So, is there any free software, or utilities, to debug the freeing of memory
?

Thanks in advance

Mourad


Jim Deutch

2004-04-28, 12:33 pm

On Wed, 28 Apr 2004 17:26:30 +0200, "Mourad DJEBLI"
<m.djebli@alfainfo.fr> wrote:

>Hi, All,
>
>I work with VB6, and ActiveX
>So I note that the memory doesn't free when the form ou usercontrol is
>unloaded, and so the ammount of memory that my program use increase
>each time I launch my form.


Unload Form1
Set Form1 = Nothing

(note: you can't use Set Me = Nothing in the form itself!)

Jim Deutch
Mourad DJEBLI

2004-04-29, 11:43 pm

Hi,
Thanks for yor answer

It's excatly what I did

So in my MdiForm I call the form.show

and in the Form_QueryUnload event,
I write :
Unload(me)
set Form = nothing

If I understund your suggestion, I have to set
set form = nothing

outside the form events from my mdiform for example ?

Thanks

Mourad


"Jim Deutch" <103134.3516@compuserve.com> a écrit dans le message news:
408fd3a3.97059774@news.compuserve.com...
> On Wed, 28 Apr 2004 17:26:30 +0200, "Mourad DJEBLI"
> <m.djebli@alfainfo.fr> wrote:
>
>
> Unload Form1
> Set Form1 = Nothing
>
> (note: you can't use Set Me = Nothing in the form itself!)
>
> Jim Deutch



Bob Butler

2004-04-29, 11:43 pm

"Mourad DJEBLI" <m.djebli@alfainfo.fr> wrote in message
news:c6qr18$apf$1@s1.read.news.oleane.net
> Hi,
> Thanks for yor answer
>
> It's excatly what I did
>
> So in my MdiForm I call the form.show
>
> and in the Form_QueryUnload event,
> I write :
> Unload(me)


that syntax is not correct for VB; use
Unload Me
or
Call Unload(Me)

> set Form = nothing


Set <whateverthenameofthemdiformis> = Nothing

> If I understund your suggestion, I have to set
> set form = nothing
>
> outside the form events from my mdiform for example ?


No, you can do it anywhere. You just can't use "Set Me=Nothing" because
that is invalid

--
Reply to the group so all can participate
VB.Net... just say "No"

Mourad DJEBLI

2004-04-29, 11:44 pm

Thanks, for your anwers
They're very usefull.

Good work
Mourad



"Bob Butler" <tiredofit@nospam.com> a écrit dans le message news:
uFSZnPeLEHA.1644@TK2MSFTNGP09.phx.gbl...
> "Mourad DJEBLI" <m.djebli@alfainfo.fr> wrote in message
> news:c6qr18$apf$1@s1.read.news.oleane.net
>
> that syntax is not correct for VB; use
> Unload Me
> or
> Call Unload(Me)
>
>
> Set <whateverthenameofthemdiformis> = Nothing
>
>
> No, you can do it anywhere. You just can't use "Set Me=Nothing" because
> that is invalid
>
> --
> Reply to the group so all can participate
> VB.Net... just say "No"
>



J French

2004-04-29, 11:44 pm

On Thu, 29 Apr 2004 14:09:47 +0200, "Mourad DJEBLI"
<m.djebli@alfainfo.fr> wrote:

>Hi,
>Thanks for yor answer
>
>It's excatly what I did
>
>So in my MdiForm I call the form.show
>
>and in the Form_QueryUnload event,
>I write :
> Unload(me)
> set Form = nothing
>
>If I understund your suggestion, I have to set
> set form = nothing
>
>outside the form events from my mdiform for example ?


As Bob has pointed out, you are using a funny version of VB for that
code to exist
- also it is a bit silly doing an Unload in Query_Unload

You want to watch the Terminate Events of all your Forms, Classes and
UserControls
- and watch them /very/ carefully


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com