WindowsForms, ActiveX, Interop, GC

G

Guest

Hi all, i develop app in windows forms, in C#. I used WindowsForms yo host
ActiveX like, Flash, QuickTime, Quest3D, and so on. But i have a problem,
because when flash AxHost control uses lot of memory and i manually whant to
dispose and delete this object, the GC collector doesnt's recollect all the
memory. So my question is: Is there other way to Dispose a AxHostControl, o
WindowsForm to recover all the memory. Thanxs.
 
D

Dmytro Lapshyn [MVP]

Hi,

First of all, try the plain old Dispose method on the AxHost-derived
controls. It should release the hosted ActiveX as well (while GC.Collect
doesn't guarantee this, AFAIR).

If this doesn't help, try calling Marshal.ReleaseComObject on the AxHost's
GetOcx() return value, and then call Dispose as usual.
 
G

Guest

I tried the ReleaseComObject, but doesn't work. I call firts Dispose then
ReleaseComObject and then GC.SupressFinalizer. What i will do?. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top