Reputation: 189
I have defined the pointer size_Drive as :
PCHAR size_Drive ;
then i used the function lstrlen :
size_Drive += (lstrlen(size_Drive) + 1) ; (line 28)
but it gives me the following ERROR :
1>c:\users\hp.hp-pc\documents\visual studio 2008\projects\getvolumeinfo\getvolumeinfo\getvolumeinfo.cpp(28) : error C2664: 'lstrlenW' : cannot convert parameter 1 from 'PCHAR' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Upvotes: 0
Views: 1297
Reputation: 37122
PCHAR
is a typedef for char
whereas LPCWSTR
is a typedef for const wchar_t*
, and in a Unicode build lstrlen
is a macro for the Unicode function lstrlenW
.
You should call lstrlenA
specifically to use the ANSI function.
Upvotes: 1