CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 1999
    Posts
    4

    Releasing memory for an active x component



    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



  2. #2
    Join Date
    May 1999
    Posts
    45

    Re: Releasing memory for an active x component



    After unloading it try explicit destruction

    Set Mycontrol(I) = Nothing

  3. #3
    Join Date
    Mar 1999
    Posts
    4

    Re: Releasing memory for an active x component



    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

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

Featured