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

Visual Basic Classic

Avatar of undefined
Last Comment
BrianGEFF719

8/22/2022 - Mon
BrianGEFF719

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


-Brian
ASKER CERTIFIED SOLUTION
BrianGEFF719

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes