Forms 5.0 and ActiveX Controls

From: Luc Gyselinck <lgy_at_net4all.be>
Date: Tue, 5 May 1998 23:48:25 +0200
Message-ID: <354f8949.0_at_news-feed.bru.tfi.be>



I experienced the following problem.

I created an ActiveX control with the MFC ActiveX ControlWizard using VC++. I compiled it and tested it with the ActiveX Test Container.

Then I created a simple Forms5.0 with one block and one item, type ActiveX Control.
I inserted the control into the item, compiled the form.

If I run the form with F50run32 from within VC++ (executable for debug session in Project->Settings->Debug
set to f50run32.exe) and exit the form, there is a memory leak. I get a dump of not freed memory blocks.

I found out that the control reference count drops to 1 in stead of 0 when the form is closed.
So the control is not destroyed.

As a solution, I added a InternalRelease() to the OnCreate() overwritten virtual function. At that moment,
the reference count is greather than 1.

Testing the control with this modification, makes the memory leak disappear. But testing it with
the test container, the container crashes.

Is this a bug in Forms 5.0 (and AddRef that is not Release()) or do I have to implement something extra
in my ActiveX control?

Thanks in advance. Received on Tue May 05 1998 - 23:48:25 CEST

Original text of this message