LPWSTR l = L"D:/MyFile.txt";
I've searched everywhere, but couldnt find the answer. Thank you!
LPWSTR l = L"D:/MyFile.txt";
I've searched everywhere, but couldnt find the answer. Thank you!
Long Pointer to Wide Character String. And you didn't search everywhere cause 1st google hit on LPWSTR points to MSDN:
The LPWSTR type is a 32-bit pointer to a string of 16-bit Unicode characters, which MAY be null-terminated. The LPWSTR type specifies a pointer to a sequence of Unicode characters, which MAY be terminated by a null character (usually referred to as "null-terminated Unicode").
typedef wchar_t* LPWSTR, *PWSTR;
And L
in front of the literal specifies how the literal should be understood. It's kind of like suffixes for numeric types e.g: 10u
, 4.0f
. Because type is W
(wchar_t
), the appropriate counterpart for a literal definition is L
.