Delphi 4 ActiveX problems.

I'm writing ActiveX controls in Delphi 4 to access various types of
real-time data in a proprietary application. I'm adding controls to an
existing library (OCX). Adding the necessary interfaces in the Type Library
Editor is no problem, but when I try to either refresh the implementation or
import the library in Delphi 4 I have problems.

If I try to refresh the implementation, most of the time I get an access
violation in dphide40.bpl. Originally I wasn't getting this access
violation, but now I seem to get it every time I try. I've no idea what, if
anything, I've changed that should have caused it. All I've done is add an
interface for the methods/properties and add a disp interface for the events
I want to associate with it.

Also, whenever I try to import the library, and out parameter is added to
all functions in the xxx_TLB.pas file which previously haven't existed. The
addition of these out parameters seems completely pointless to me as they're
functions and hence return anyway! As a consequence of this, the control
can't be used as specified as Delphi complains about there being "not enough
actual parameters". Importing the library in Delphi 3 doesn't present such

I tried updates 2 and 3 which didn't resolve the matter and a search of
Inprise.Com reveals nothing.

My questions essentially are: have any of you experience of these problems?
Am I doing something wrong which has caused it or does it just sound like
Delphi 4 is a bit buggy? Is Delphi 4 doing it right and Delphi 3 doing it
wrong? Have any of you any suggestions?

I'm quite new both the Delphi and ActiveX/COM so please be patient/gentle
with me.

Thanks in advance for any replies.