My code:
DrawText (hdc, TEXT ("PPPPPPP"), -1, &, DT_SINGLELINE|DT_CENTER|DT_VCENT);
Compiler gives me this erorr:
[Error] expected expression before ',' token
Thanks.
My code:
DrawText (hdc, TEXT ("PPPPPPP"), -1, &, DT_SINGLELINE|DT_CENTER|DT_VCENT);
Compiler gives me this erorr:
[Error] expected expression before ',' token
Thanks.
That lonely &
is the error, that's not correct syntax: the unary address-of operator &
needs something to take the address of, and you're not providing an argument to the operator.
From this documentation page, the fourth argument to DrawText()
is a pointer to a RECT
structure which you seem to be missing.
Without seeing more of your code, it's hard to know what your particular RECT
instance is called.
This is because you are using unary &
operator without its operand. You need an operand (which must be an l-value) for &
operator otherwise its a compilation error. If you declare the RECT
structure then fourth argument is a pointer to RECT
, like &rect
;
RECT rect;
...
DrawText (hdc, TEXT("PPPPPPP"), -1, &rect, DT_SINGLELINE|DT_CENTER|DT_VCENT);