Hello,
I came across this definition of an inline macro that seems "suspicious", it is:
// Macro 160
// #define TreeView_GetItemRect(hwnd, hitem, prc, code) \
// (*(HTREEITEM *)prc = (hitem), (BOOL)SNDMSG((hwnd), TVM_GETITEMRECT, (WPARAM)(code), (LPARAM)(RECT *)(prc)))
Function TreeView_GetItemRect( hwnd : hwnd; hitem: HTREEITEM; code : WPARAM; prc : pRECT):BOOL;inline;
Begin
HTREEITEM(prc):=HITEM;
Result:=Bool(SendMessage((hwnd), TVM_GETITEMRECT, code, LPARAM(prc)));
end;
Function TreeView_GetItemRect( hwnd : hwnd; hitem: HTREEITEM; var prc : TRECT;code : Bool):BOOL;inline;
Begin
HTREEITEM(Pointer(@prc)^):=HITEM;
Result:=Bool(SendMessage((hwnd), TVM_GETITEMRECT, WPARAM(code), LPARAM(@prc)));
end;
Note that "code" (in line 2) is the last parameter in the macro but, in the definition in line 5, the last parameter is "prc" instead of "code".
Also, on line 7, the parameter "prc" is being assigned the value of "hitem" (typed in capitals instead of in lowercase, which can cause confusion.) "prc" should not be set to "hitem" the _contents_ of "prc" should be set to "hitem". IOW, in like 7, "prc" should be dereferenced to set the _value_ of the rectangle to "hitem" (as is done in line 13)