We are using Delphi 10.3.2. with OSX64 support. We are developing a project on OSX64 that uses GCC compiled dylib. Dylib libraries on OSX64 by default are not stdcall or cdecl so we have to remove on all functions those directives. We have a problem with QueryInterface
that we have to change from stdcall to nothing.
We tried creating our own class of MyIINterface
and TMYInterfacedObject
but it cannot compile since it returns error
E2211 Declaration of 'QueryInterface' differs from declaration in interface 'MyIInterface'
mycom.pas(10): Related member: function QueryInterface(const TGUID; out): HRESULT;
How is this possible? Also if we rename QueryInterface
to QueryInterface2
in MyIINterface
it still requires QueryInterface
.
type
MyIInterface = interface
['{00000000-0000-0000-C000-000000000046}']
function QueryInterface(const IID: TGUID; out Obj): HResult;
function _AddRef: Integer;
function _Release: Integer;
end;
MyIUnknown = IInterface;
TMyInterfacedObject = class(TObject, MyIInterface)
protected
function QueryInterface(const IID: TGUID; out Obj): HResult;
stdcall
andcdecl
only apply to 32bit compilations, they are ignored on 64bit compilations. 64bit compilers automatically use the proper 64bit calling convention for the system being compiled for. So you don't need to remove the calling conventions from code declarations. Whatever problem you are experiencing is related to something else. – Remy Lebeau