WindowsForms, ActiveX, Interop, GC

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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.
 
I tried the ReleaseComObject, but doesn't work. I call firts Dispose then
ReleaseComObject and then GC.SupressFinalizer. What i will do?. Thanks.
 
Back
Top