I'm new to winAPI and encountered a problem I can't seem to solve... Couldn't find a solution by google yet, either.
My program has several buttons of similar size so I made a macro to hide all the mess. The original macro was:
#define _BUTTON(s, x, y, v) CreateWindowW(L"Button", (L)s, WS_VISIBLE | WS_CHILD, x, y, 75, 25, hWnd, (HMENU)v, 0, 0);
However, "L(s)
" doesn't work with or without the parenthesis, on s
or L
. I also tried replacing L
with LPCWSTR
, WCHAR*
, _T()
, etc... The compiler error is always the same: "L (or LPCWSTR, etc) is not declared in this scope"
although I thought it should be...
For now I resolved the issue by going with the non-Unicode:
#define _BUTTON(s, x, y, v) CreateWindow("Button", s, WS_VISIBLE | WS_CHILD, x, y, 75, 25, hWnd, (HMENU)v, 0, 0);
But I'd like all the windows to support the same chars... Where is the problem?