Interface ITypeInfo question lazarus / 67-Windows ---------------------------------------------------------------------- 440bx · 2025-06-28 05:42 Hello, In activex.pp, ITypeInfo is defined as follows:Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i    ITypeInfo = Interface (IUnknown)     ['{00020401-0000-0000-C000-000000000046}']     {$ifndef Call_as}    Function  GetTypeAttr(OUT ppTypeAttr: lpTYPEATTR):HResult;StdCall;     {$else}      Function  GetTypeAttr(OUT ppTypeAttr: LPTYPEATTR; OUT pDummy: CLEANLOCALSTORAGE):HResult;StdCall;     {$endif}      Function  GetTypeComp(OUT ppTComp: ITypeComp):HResult;StdCall;     {$ifndef Call_as}      Function  GetFuncDesc(index: UINT; OUT ppFuncDesc: lpFUNCDESC):HResult;StdCall;      Function  GetVarDesc(index: UINT; OUT ppVarDesc: lpVARDESC):HResult;StdCall;      Function  GetNames(memid: MEMBERID;  rgBstrNames: PBStrList; cMaxNames: UINT; OUT pcNames: UINT):HResult;StdCall;     {$else}      Function  GetFuncDesc(index: UINT; OUT ppFuncDesc: LPFUNCDESC; OUT pDummy: CLEANLOCALSTORAGE):HResult;StdCall;      Function  GetVarDesc(index: UINT; OUT ppVarDesc: LPVARDESC; OUT pDummy: CLEANLOCALSTORAGE):HResult;StdCall;      Function  GetNames(memid: MEMBERID;  rgBstrNames: PBStrList; cMaxNames: UINT; OUT pcNames: UINT):HResult;StdCall;     {$endif}     Function  GetRefTypeOfImplType(index: UINT; OUT pRefType: HREFTYPE):HResult;StdCall;     Function  GetImplTypeFlags(index: UINT; OUT pImplTypeFlags: WINT):HResult;StdCall;     {$ifndef Call_as}      Function  GetIDsOfNames(CONST rgszNames: pOleStr; cNames: UINT; OUT pMemId: MEMBERID):HResult;StdCall;     {$else}      Function  LocalGetIDsOfNames():HResult;StdCall;     {$endif}     {$ifndef Call_as}     Function  Invoke(pvInstance: Pointer; memid: MEMBERID; wFlags: WORD; VAR pDispParams: DISPPARAMS; pVarResult: PVARIANT; pExcepInfo: PEXCEPINFO; puArgErr: PUINT):HResult;StdCall;     {$else}     Function  LocalInvoke ():HResult;StdCall;     {$endif}     {$ifndef Call_as}     //Function  GetDocumentation(memid: MEMBERID; OUT pBstrName: WideString; OUT pBstrDocString: WideString; OUT pdwHelpContext: DWORD; OUT pBstrHelpFile: WideString):HResult;StdCall;         Function  GetDocumentation(memid: MEMBERID; pBstrName: PWideString; pBstrDocString: PWideString; pdwHelpContext: PDWORD; pBstrHelpFile: PWideString):HResult;StdCall;   {$else}         Function  GetDocumentation(memid: MEMBERID; refPtrFlags: DWORD; OUT pBstrName: WideString; OUT pBstrDocString: WideString; OUT pdwHelpContext: DWORD; OUT pBstrHelpFile: WideString):HResult;StdCall;     {$endif}      {$ifndef Call_as}     Function  GetDllEntry(memid: MEMBERID; invKind: INVOKEKIND; OUT pBstrDllName: WideString; OUT pBstrName: WideString; OUT pwOrdinal: WORD):HResult;StdCall;     {$else}     Function  GetDllEntry(memid: MEMBERID; invKind: INVOKEKIND; refPtrFlags: DWORD; OUT pBstrDllName: WideString; OUT pBstrName: WideString; OUT pwOrdinal: WORD):HResult;StdCall;     {$endif}      Function  GetRefTypeInfo(hRefType: HREFTYPE; OUT ppTInfo: ITypeInfo):HResult;StdCall;      {$ifndef Call_as}      Function  AddressOfMember(memid: MEMBERID; invKind: INVOKEKIND; OUT ppv: Pointer):HResult;StdCall;     {$else}      Function  LocalAddressOfMember():HResult;StdCall;     {$endif}      {$ifndef Call_as}      Function  CreateInstance(CONST pUnkOuter: IUnknown; CONST riid: TIID; OUT ppvObj: Pointer):HResult;StdCall;     {$else}    Function  CreateInstance(CONST riid: TIID; OUT ppvObj: pIUnknown):HResult;StdCall;     {$endif}     Function  GetMops(memid: MEMBERID; OUT pBstrMops: WideString):HResult;StdCall;     {$ifndef Call_as}     Function  GetContainingTypeLib(OUT ppTLib: ITypeLib; OUT pIndex: UINT):HResult;StdCall;     {$else}     Function  GetContainingTypeLib(OUT ppTLib: ITypeLib; OUT pIndex: UINT):HResult;StdCall;     {$endif}     {$ifndef Call_as}      Procedure ReleaseTypeAttr( pTypeAttr: pTypeAttr); StdCall;     {$else}      Function  ReleaseTypeAttr():HResult;StdCall;     {$endif}      {$ifndef Call_as}      Procedure ReleaseFuncDesc( pFuncDesc : lpFUNCDESC); StdCall;     {$else}      Function  LocalReleaseFuncDesc():HResult;StdCall;     {$endif}     {$ifndef Call_as}      Procedure ReleaseVarDesc( pVarDesc : lpVarDesc); stdcall;     {$else}      Function  LocalReleaseVarDesc():HResult;StdCall;     {$endif}     End; The method definitions change depending on whether "Call_as" is defined or not.  It does not seem that "Call_as" is defined anywhere, i.e, it seems to always be undefined. The question is: what are the definitions when "Call_as" is defined for ?  (the number of parameters in the method are not the same but, it is rather unclear as to why that is.) Thank you for your help. ---------------------------------------------------------------------- marcov · 2025-06-28 08:17 I don't know. I assume it was in the original header. If you search for the parameter https://learn.microsoft.com/zh-tw/dotn et/api/microsoft.visualstudio.ole.interop.cleanlocalstorage?view=visua lstudiosdk-2017 it points to being for interop. ---------------------------------------------------------------------- 440bx · 2025-06-28 08:37 Quote from: marcov on June 28, 2025, 10:17:34 amI don't know. I assume it was in the original header. If you search for the parameter https://learn.microsoft.com/zh-tw/dotn et/api/microsoft.visualstudio.ole.interop.cleanlocalstorage?view=visua lstudiosdk-2017 it points to being for interop. In another post, ASerge showed that in the .idl file, the call_as is used to define synonyms for some methods.  I think that's the origin of that stuff in the Pascal source but, I don't think the semantics of "call_as" have a counterpart in FPC. Anyway, I look at the C definitions because that's what gets executed.  if it's not in the C++ class definition, I don't include it but, I was curious as to where that came from and why. Thanks for the info marco. ---------------------------------------------------------------------- marcov · 2025-06-28 08:45 Now that I read ASerge's post, I do think I used the IDLs for the interface definitions back then, as they were (for me then) more 1:1 to interfaces than the generated C declarations. ---------------------------------------------------------------------- ASerge · 2025-06-28 08:47 Quote from: 440bx on June 28, 2025, 07:42:43 amThe question is: what are the definitions when "Call_as" is defined for ? It's MIDL attribute. See call-as, local.