Struct initialization with parameters?

ld like to use a struct into a function fillRect, containing the memeber values in the call

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// this is from some library
typedef struct tagRECT
{
    LONG    left;
    LONG    top;
    LONG    right;
    LONG    bottom;
} RECT, *PRECT, NEAR *NPRECT, FAR *LPRECT;

typedef const RECT FAR* LPCRECT;

// my code
FillRect(ignore1, const tagRect *lprc, ignore2); // prototype of FillRect

// lnstead of this
RECT r = {20,20,50,50};
FillRect(ignore1, &r, ignore2);

// but ld like to use in this way if its possible?
FillRect(ignore1, RECT(20,20,50,50), ignore2);

Last edited on
1
2
auto MyFillRect(ignore1, RECT const& r, ignore2) noexcept
{ return FillRect(ignore1, &r, ignore2); }
Topic archived. No new replies allowed.