Forum > Windows

Possible error in ActiveX interface definition

(1/2) > >>

440bx:
Hello,

In ActiveX.pp IEnumMoniker is defined as follows:
--- 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";}};} ---    IEnumMoniker = Interface (IUnknown)       ['{00000102-0000-0000-C000-000000000046}']       Function Next(celt:ULong; out Elt;out celftfetched: ULong):HResult; StdCall;//     Function RemoteNext(Celt:ULong; Out rgelt;out celtfetched :ULong):Hresult; StdCall;       Function Skip(celt:Ulong):HResult; StdCall;       Function Reset:HResult; StdCall;       Function Close(out penum:IEnumMoniker):HResult;StdCall;       End; Note the name of the last method in that definition is "Close".

in objidl.h the C++ definition of the class is
--- 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("00000102-0000-0000-C000-000000000046")    IEnumMoniker : public IUnknown    {    public:        virtual /* [local] */ HRESULT STDMETHODCALLTYPE Next(             /* [in] */ ULONG celt,            /* [annotation] */             _Out_writes_to_(celt,*pceltFetched)  IMoniker **rgelt,            /* [annotation] */             _Out_opt_  ULONG *pceltFetched) = 0;                virtual HRESULT STDMETHODCALLTYPE Skip(             /* [in] */ ULONG celt) = 0;                virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;                virtual HRESULT STDMETHODCALLTYPE Clone(             /* [out] */ __RPC__deref_out_opt IEnumMoniker **ppenum) = 0;          };Note the name of the last method is "Clone" not "Close" as it appears in the Pascal definition.

dsiders:

--- Quote from: 440bx on April 03, 2024, 12:57:51 am ---Hello,

In ActiveX.pp IEnumMoniker is defined as follows:
--- 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";}};} ---    IEnumMoniker = Interface (IUnknown)       ['{00000102-0000-0000-C000-000000000046}']       Function Next(celt:ULong; out Elt;out celftfetched: ULong):HResult; StdCall;//     Function RemoteNext(Celt:ULong; Out rgelt;out celtfetched :ULong):Hresult; StdCall;       Function Skip(celt:Ulong):HResult; StdCall;       Function Reset:HResult; StdCall;       Function Close(out penum:IEnumMoniker):HResult;StdCall;       End; Note the name of the last method in that definition is "Close".

in objidl.h the C++ definition of the class is
--- 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("00000102-0000-0000-C000-000000000046")    IEnumMoniker : public IUnknown    {    public:        virtual /* [local] */ HRESULT STDMETHODCALLTYPE Next(             /* [in] */ ULONG celt,            /* [annotation] */             _Out_writes_to_(celt,*pceltFetched)  IMoniker **rgelt,            /* [annotation] */             _Out_opt_  ULONG *pceltFetched) = 0;                virtual HRESULT STDMETHODCALLTYPE Skip(             /* [in] */ ULONG celt) = 0;                virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;                virtual HRESULT STDMETHODCALLTYPE Clone(             /* [out] */ __RPC__deref_out_opt IEnumMoniker **ppenum) = 0;          };Note the name of the last method is "Clone" not "Close" as it appears in the Pascal definition.

--- End quote ---

Strangely enough, the declaration is correct in packages/winunits-jedi/src/jwaactivex.pas.

440bx:

--- Quote from: dsiders on April 03, 2024, 01:32:17 am ---Strangely enough, the declaration is correct in packages/winunits-jedi/src/jwaactivex.pas.

--- End quote ---
I've noticed in a number of occasions that the JEDI units tend to be more "accurate".  Looks like there was more manual effort involved in their translation.

Thaddy:
It may well be the other way around.This looks more like a typo.
Anyway, that is one of the reasons I still use the D2007/D7 type library importers over the FreePascal one.

marcov:

--- Quote from: 440bx on April 03, 2024, 01:36:07 am ---
--- Quote from: dsiders on April 03, 2024, 01:32:17 am ---Strangely enough, the declaration is correct in packages/winunits-jedi/src/jwaactivex.pas.

--- End quote ---
I've noticed in a number of occasions that the JEDI units tend to be more "accurate".  Looks like there was more manual effort involved in their translation.

--- End quote ---

IMHO too generalised a statement, and frankly speaking, unfair.   To start with, the original Windows unit and later additions and the various parts of winunits-base all have different history with how the conversion was done (e.g. the original nineties semi automatic windows unit conversion garbled comments and used a lot of VAR). Later conversions learned from the gotchas of the earlier ones.

JEDI's would have had many, many more eyes in the early days, so more initial errors in core units would have been solved. They might have also compared to the Borland units, as they were not as concerned with copyright. But also there some units were earlier converted and more used than others. But the worst thing is that FPC tried to get things 64-bit clean much earlier, and Jedi still were targeting D7.

Navigation

[0] Message Index

[#] Next page

Go to full version