From: Vincent Fatica on 24 May 2010 21:34 On Mon, 24 May 2010 20:59:53 -0400, "Igor Tandetnik" <itandetnik(a)mvps.org> wrote: |Vincent Fatica <vince(a)blackholespam.net> wrote: |> error C2664: 'error' : cannot convert parameter 1 from 'LPCWSTR' to |> 'LPTSTR' Conversion loses qualifiers |> |> Why? Aren't "LPCWSTR" and "const LPWSTR" both "const WCHAR*"? | |No. LPCWSTR is "const WCHAR*" - a non-const pointer to const data. "const LPWSTR" is "WCHAR* const" - a const pointer to non-const data. Your function, by taking LPTSTR, declares that it may modify pointed-to data - that's why it can't accept LPCWSTR (where, again, the data is const). I get it. Thanks to both of you, Igor and Doug. -- - Vince
First
|
Prev
|
Pages: 1 2 Prev: "PORTING C" > help comparing a pointer's value to NULL ? Next: DevStudio question |