Forum > Windows

IMoniker possible error in definition

(1/2) > >>

440bx:
Hello,

the IMoniker interface in ActiveX is defined as:
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---    PIMoniker = ^IMoniker;    IMoniker = Interface (IPersistStream)      ['{0000000f-0000-0000-C000-000000000046}']      Function BindToObject (const pbc:IBindCtx;const mktoleft:IMoniker; const RiidResult:TIID;Out vresult):HResult;StdCall;//    Function RemoteBindToObject (const pbc:IBindCtx;const mktoleft:IMoniker;const RiidResult:TIID;Out vresult):HResult;StdCall;      Function BindToStorage(Const Pbc:IBindCtx;Const mktoLeft:IMoniker; const Riid:TIID;Out vobj):HResult; StdCall;//    Function RemoteBindToStorage(Const Pbc:IBindCtx;Const mktoLeft:IMoniker;const Riid:TIID;Out vobj):HResult; StdCall;      Function Reduce (const pbc:IBindCtx; dwReduceHowFar:DWord; mktoLeft: PIMoniker; Out mkReduced:IMoniker):HResult; StdCall;      Function ComposeWith(Const MkRight:IMoniker;fOnlyIfNotGeneric:BOOL; OUT mkComposite:IMoniker):HResult; StdCall;      Function Enum(fForward:Bool;Out enumMoniker:IEnumMoniker):HResult;StdCall;      Function IsEqual(Const mkOtherMoniker:IMoniker):HResult;StdCall;      Function Hash   (Out dwHash:Dword):HResult;StdCall;      Function IsRunning(Const bc:IBindCtx;Const MkToLeft:IMoniker;Const mknewlyRunning:IMoniker):HResult;StdCall;      Function GetTimeOfLastChange(Const bc:IBindCtx;Const mkToLeft:IMoniker; out ft : FileTime):HResult; StdCall;      Function Inverse(out mk : IMoniker):HResult; StdCall;        Function CommonPrefixWith (Const mkOther:IMoniker):HResult; StdCall;        Function RelativePathTo(Const mkother:IMoniker; Out mkRelPath : IMoniker):HResult;StdCall;      Function GetDisplayName(Const bc:IBindCtx;const mktoleft:IMoniker;Out szDisplayName: pOleStr):HResult; StdCall;      Function ParseDisplayName(Const bc:IBindCtx;Const mkToLeft:IMoniker;szDisplayName:POleStr;out cheaten:ULong;out mkOut:IMoniker):HResult; StdCall;      Function IsSystemMoniker(Out dwMkSys:DWord):HResult;StdCall;      End; Note the definition of the CommonPrefixWith method has only one parameter.

the C++ interface in objidl.h defines it as:
--- Code: C  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---    MIDL_INTERFACE("0000000f-0000-0000-C000-000000000046")    IMoniker : public IPersistStream    {    public:        virtual /* [local] */ HRESULT STDMETHODCALLTYPE BindToObject(             /* [annotation][unique][in] */             _In_  IBindCtx *pbc,            /* [annotation][unique][in] */             _In_opt_  IMoniker *pmkToLeft,            /* [annotation][in] */             _In_  REFIID riidResult,            /* [annotation][iid_is][out] */             _Outptr_  void **ppvResult) = 0;                virtual /* [local] */ HRESULT STDMETHODCALLTYPE BindToStorage(             /* [annotation][unique][in] */             _In_  IBindCtx *pbc,            /* [annotation][unique][in] */             _In_opt_  IMoniker *pmkToLeft,            /* [annotation][in] */             _In_  REFIID riid,            /* [annotation][iid_is][out] */             _Outptr_  void **ppvObj) = 0;                virtual HRESULT STDMETHODCALLTYPE Reduce(             /* [unique][in] */ __RPC__in_opt IBindCtx *pbc,            /* [in] */ DWORD dwReduceHowFar,            /* [unique][out][in] */ __RPC__deref_opt_inout_opt IMoniker **ppmkToLeft,            /* [out] */ __RPC__deref_out_opt IMoniker **ppmkReduced) = 0;                virtual HRESULT STDMETHODCALLTYPE ComposeWith(             /* [unique][in] */ __RPC__in_opt IMoniker *pmkRight,            /* [in] */ BOOL fOnlyIfNotGeneric,            /* [out] */ __RPC__deref_out_opt IMoniker **ppmkComposite) = 0;                virtual HRESULT STDMETHODCALLTYPE Enum(             /* [in] */ BOOL fForward,            /* [out] */ __RPC__deref_out_opt IEnumMoniker **ppenumMoniker) = 0;                virtual HRESULT STDMETHODCALLTYPE IsEqual(             /* [unique][in] */ __RPC__in_opt IMoniker *pmkOtherMoniker) = 0;                virtual HRESULT STDMETHODCALLTYPE Hash(             /* [out] */ __RPC__out DWORD *pdwHash) = 0;                virtual HRESULT STDMETHODCALLTYPE IsRunning(             /* [unique][in] */ __RPC__in_opt IBindCtx *pbc,            /* [unique][in] */ __RPC__in_opt IMoniker *pmkToLeft,            /* [unique][in] */ __RPC__in_opt IMoniker *pmkNewlyRunning) = 0;                virtual HRESULT STDMETHODCALLTYPE GetTimeOfLastChange(             /* [unique][in] */ __RPC__in_opt IBindCtx *pbc,            /* [unique][in] */ __RPC__in_opt IMoniker *pmkToLeft,            /* [out] */ __RPC__out FILETIME *pFileTime) = 0;                virtual HRESULT STDMETHODCALLTYPE Inverse(             /* [out] */ __RPC__deref_out_opt IMoniker **ppmk) = 0;                  virtual HRESULT STDMETHODCALLTYPE CommonPrefixWith(             /* [unique][in] */ __RPC__in_opt IMoniker *pmkOther,            /* [out] */ __RPC__deref_out_opt IMoniker **ppmkPrefix) = 0;                  virtual HRESULT STDMETHODCALLTYPE RelativePathTo(             /* [unique][in] */ __RPC__in_opt IMoniker *pmkOther,            /* [out] */ __RPC__deref_out_opt IMoniker **ppmkRelPath) = 0;                virtual HRESULT STDMETHODCALLTYPE GetDisplayName(             /* [unique][in] */ __RPC__in_opt IBindCtx *pbc,            /* [unique][in] */ __RPC__in_opt IMoniker *pmkToLeft,            /* [out] */ __RPC__deref_out_opt LPOLESTR *ppszDisplayName) = 0;                virtual HRESULT STDMETHODCALLTYPE ParseDisplayName(             /* [unique][in] */ __RPC__in_opt IBindCtx *pbc,            /* [unique][in] */ __RPC__in_opt IMoniker *pmkToLeft,            /* [in] */ __RPC__in LPOLESTR pszDisplayName,            /* [out] */ __RPC__out ULONG *pchEaten,            /* [out] */ __RPC__deref_out_opt IMoniker **ppmkOut) = 0;                virtual HRESULT STDMETHODCALLTYPE IsSystemMoniker(             /* [out] */ __RPC__out DWORD *pdwMksys) = 0;           };Note that the method "CommonPrefixWith" has two parameters.

to whoever it may be of interest, the jwaactivex.pas file has the correct definition.

Thaddy:
It is of interest, but it is a known issue that FPC does not really conform. At least to me.

marcov:
Fixed in trunk.

Thaddy:
Tnx Marco, I know you authored this.

marcov:
The original interface support (and specially its OUT) support was very long in the coming (2.0.4-2.4.x and even 3.0.x), so probably in the early days interfaces were more added to get test code running than to be run.
(and COM in general was not very practical for 32-bit till 3.2.x changed to SEH anyway, which is only a few years back)

Navigation

[0] Message Index

[#] Next page

Go to full version