Link to home
Start Free TrialLog in
Avatar of viswanathat
viswanathat

asked on

ActiveX Control Releasing Resources OnClose

Dear All,

I am writing a generic ActiveX control container, in MFC VC6 to hold the controls designed through VB6.

Here I am dynamically creating the controls at RunTime through CWnd::CreateControl() function. At this stage memory and gdi objects of the container is increasing. It is ok due to the resources in activex are created by now.

Even though I call DestroyWindow and deleting the Control window pointer on Close of the Container page, The Memory allotted and GDI Objects in Task manager are not reducing.

So Frequent opening of saved MDI pages containing ActiveX controls is causing a huge memory leak.

The controls are simple and with bitmaps and shapes.

If I use object = Nothing for the bitmaps and shapes (OnTerminate) the GDI and memory usage reduces by 30 percent.

Where could be the actual  problem.. in container or control side? Any more cleanup activity is to be done in activex controls?

Regards
Viswanath AT

Avatar of BrianGEFF719
BrianGEFF719
Flag of United States of America image

The problem is in the control that is creating the objects...in this case the container (active x control).


-Brian
ASKER CERTIFIED SOLUTION
Avatar of BrianGEFF719
BrianGEFF719
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial