Click to See Complete Forum and Search --> : Releasing memory for an active x component


Darryl Ingalls
March 18th, 1999, 08:50 PM
I have created an active x control using VB (I know probably my first mistake) it emulates a textbox control, created to draw our specialized fonts, and supports blinking,and animating, done with timers. I have subclassed this control and created timers and watch for them in my message dispatch, not using timer controls.


anyway with what that little info out of the way, I use these controls in arrays of controls in other vb projects, i'm constantly resizing the array, by adding and unloading them, but it seems that when I unload them, vb doesn't release all the memory associated with them, and when i load new ones it just adds more memory. I've created a destroy mechanism in the control, that i call right before I unload the control. which replaces the old win proc and kills the timers associated to it and I kill the specialized font classes that are being used in this control. but the memory isn't being released.


if anyone has suggestions on how I can get the memory released, i would really appreciate it.


thanks


darryl

Vinayak Sapre
March 18th, 1999, 08:55 PM
After unloading it try explicit destruction

Set Mycontrol(I) = Nothing

Darryl Ingalls
March 18th, 1999, 09:11 PM
thanks vinayak, that seems to have helped.

I must've vegged out on that one. I guess

I was thinking that you couldn't set a control to nothing

not realizing you can't do that with design time created

control but you can with runtime created ones. Again thanks

alot.


Darryl