AW: [fpc-pascal]Create an OCX with FreePascal

Dirk Mattes Dirk.Mattes at
Thu Oct 11 14:59:35 CEST 2001

Hi all,

> Michael Van Canneyt wrote:
> > 
> > I don't know what the OCX format is, if it is a simple 
> .dll, then it should
> > be possible.
> an OCX is a DLL, which follows some special convention (exportet names
> etc.). Writing an ActiveX Control by hand should be possible with FPC,
> but it isn't trivial, as you have to implement a lot of COM 
> interfaces.
> I think Visual C++ or the Platform SDK come with some examples how to
> write such a thing by hand, they should translate to FPC quite
> straightforwardly.

to write COM-Objects in FPC is possible and not difficult too much. 

But an OCX (ActiveX-Control) is a problem, cause has to do with
OLE-Automation. Like Michael says, you have to implement many interfaces
(i.e. IDispatch for late-binding your methods, IEnumVARIANT and others),
that Delphi or VC creates automaticly or Automation gives you in order
to you type library. Most of your interfaces have to be comaptible with
OLE-Automation. You also have to convert many Header files for constants
that OLE uses (like VT_DISPATCH and many others).

So, forget about it an use Delphi or VC.

More information about the fpc-pascal mailing list