HIMAGELIST_QueryInterface definition missing. lazarus / 67-Windows ---------------------------------------------------------------------- 440bx · 2025-05-28 05:51 The definition of HIMAGELIST_QueryInterface seems to be missing. C definition is at: https://learn.microsoft.com/en-us/windows/win32/api/commctrl/nf- commctrl-himagelist_queryinterface Pascal definition that must be modified to accommodate the different definition of REFIID in FPC: 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 function HIMAGELIST_QueryInterface           (            { _in_  } InImageList  : HIMAGELIST;            { _in_  } InIid        : REFIID;          { same as PIID / PGUID  }            { _out_ } OutInterface : ppointer         )         : HRESULT; stdcall; external comctl32; HTH. ---------------------------------------------------------------------- marcov · 2025-05-29 10:07 Committed. ---------------------------------------------------------------------- 440bx · 2025-05-29 10:11 I'm guessing you made the second parameter a "const" to cause the compiler to pass an address.  Did I get that right ? ---------------------------------------------------------------------- marcov · 2025-05-29 11:23 Quote from: 440bx on May 29, 2025, 12:11:59 pmI'm guessing you made the second parameter a "const" to cause the compiler to pass an address.  Did I get that right ? I think so. Copied it from other interface declarations. I'm wondering about if it shouldn't be constref though in mode objfpc. That always trips me up, as I generally use $mode delphi ---------------------------------------------------------------------- 440bx · 2025-05-29 11:55 Actually, strictly speaking, neither const nor constref are correct. The parameter is a pointer to an IID (a REFIID which is an IID by reference) and the C definition does not _explicitly_ say that it is constant, i.e, Code: C  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i HRESULT HIMAGELIST_QueryInterface(  [in]  HIMAGELIST himl,  [in]  REFIID     riid,  [out] void       **ppv); On the hand, since it is [in] and not [inout] then it is reasonable to presume it is constant (it is as far as the caller is concerned.) In that case, specifying either "const" or "constref" will produce the same, which is passing the parameter by reference (which is what it should do) and, the call cannot change the IID from the caller's viewpoint since it is passed by value. Succinctly, specifying either "const" or "constref" will yield the same correct result. Choosing "const" keeps that definition consistent with already existing definitions. One thing that would be nice would be to have an overload for the third _out_ parameter.  That way, instead of passing the address of a pointer, the call could pass the pointer itself (since out will take its address automatically.)  Obviously, that's optional since C doesn't have overloads (at least not standard C that I know of.) ---------------------------------------------------------------------- marcov · 2025-05-29 12:20 I think the difference between const and const ref is mostly in non 32-bit x86. For the rest we adhere to the style of the other calls which is delphi inspired to avoid compatibility problems.