Hi, I am working on debugging the memory leak of my activex control. Tracking with VS.net 2003, it told that the deconstruction function of the OCX is not called when IE is closed. I was guessing I may have memory overwritten somewhere. But later on I found even a blank OCX will have the same problem which deconstruction won't be called as well. Is it possible that it is caused by my html file? Here is the sample of the html: <html><head> <title>Test</title> </head> <body onload="" onunload="closeOcx()" leftmargin=0 rightmargin=0 topmargin=0 bottommargin=0> <div id="main"> <table border="0" cellSpacing="0" cellpadding="0" > <tr> <td colspan=3> <OBJECT id=TestOcx style="LEFT: 0px; TOP: 0px" codeBase=TestOcx.ocx height=480 width=720 align=center classid="clsid:016FD02F-9077-4286-8529-1DF5B189578E" name=TestOcx> <PARAM NAME="_Version" VALUE="65536"> <PARAM NAME="_ExtentX" VALUE="19050"> <PARAM NAME="_ExtentY" VALUE="12700"> <PARAM NAME="_StockProps" VALUE="0"></OBJECT> </td> </tr> </table> </div> </body> </html> Please help. Thanks a lot in advance! Best regards, Quentin
Just searched the article in msdn and found this: Internet Explorer does not unload controls when the browser is closed. Internet Explorer relies on proper COM reference counting. When the last reference to a control is released, the control will unload. However, I traced to COleControl deconstruction function where is supposed to decrement the reference count. But it is not called as well. Where is wrong? This problem should be not new at all. Anyone meet with it before? Please help! Thanks! Best regards, Quentin "Quentin" wrote: > Hi, > > I am working on debugging the memory leak of my activex control. Tracking > with VS.net 2003, it told that the deconstruction function of the OCX is not > called when IE is closed. I was guessing I may have memory overwritten > somewhere. > > But later on I found even a blank OCX will have the same problem which > deconstruction won't be called as well. Is it possible that it is caused by > my html file? Here is the sample of the html: > > <html><head> > <title>Test</title> > > </head> > > <body onload="" onunload="closeOcx()" leftmargin=0 rightmargin=0 topmargin=0 > bottommargin=0> > <div id="main"> > <table border="0" cellSpacing="0" cellpadding="0" > > > <tr> > <td colspan=3> > <OBJECT id=TestOcx style="LEFT: 0px; TOP: 0px" codeBase=TestOcx.ocx > height=480 > width=720 align=center classid="clsid:016FD02F-9077-4286-8529-1DF5B189578E" > name=TestOcx> > <PARAM NAME="_Version" VALUE="65536"> > <PARAM NAME="_ExtentX" VALUE="19050"> > <PARAM NAME="_ExtentY" VALUE="12700"> > <PARAM NAME="_StockProps" VALUE="0"></OBJECT> > </td> > </tr> > > </table> > </div> > </body> > </html> > > Please help. Thanks a lot in advance! > > Best regards, > Quentin