[fpc-devel] VMT compatibility
Michael Van Canneyt
michael at freepascal.org
Sun Jan 30 12:55:20 CET 2005
On Sun, 30 Jan 2005, Alexey Barkovoy wrote:
> ----- Original Message -----
> From: "Florian Klaempfl" <F.Klaempfl at gmx.de>
> >> For example "DECLARE_INTERFACE_(IClassFactory, IUnknown)" in C++ is expanded
> >> to "struct FAR IClassFactory : public IUnknown", so really public parts of
> >> VMT (with positive offset) are always [should be] compatible. Surely we can't
> >> talk about FULL compatibility of classes, but exposing "interfaces" to other
> >> languages should be possible.
> > Use raw interfaces for such a purpose.
> Problem is here:
> >> Problem here is what I'm forced to use some these COM incompatibe
> >> "interfaces" exposed by MS programmers in DirectX API. These interfaces look
> >> like real COM interfaces but without IUnknown embedded. In Delphi I can use
> >> them just by creating abstract class just like in C++, but in FPC it's
> >> impossible to do so. And I've seen other reports when people were forced to
> >> use similiar cripped interfaces exposed by C++ programmers. So it's the real
> >> problem not just artificial one.
> Delphi and FreePascal simplest interfaces already includes IUnknown. So using
> raw interfaces is incompatible here too.
You could try to use CORBA interfaces, they don't have IInterface (or IUnknown) as the parent.
There is a compiler switch for this.
More information about the fpc-devel