Create Directory
-
Hi int result=CreateDirectory(LPCSTR(Dir_Name),NULL); The above statement return 0 if i use WCHAR pointer(Dir_Name). why ?
manu
manu_2205 wrote:
int result=CreateDirectory(LPCSTR(Dir_Name),NULL);
1. Why do you need that LPCSTR there? 2. Is your project unicode aware?
Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா
-
manu_2205 wrote:
int result=CreateDirectory(LPCSTR(Dir_Name),NULL);
1. Why do you need that LPCSTR there? 2. Is your project unicode aware?
Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா
-
ya project unicode aware , if i do't write LPCSTR it generate compile time error. "error C2664: 'CreateDirectoryA' : cannot convert parameter 1 from 'WCHAR *' to 'LPCSTR'"
manu
manu_2205 wrote:
"error C2664: 'CreateDirectoryA' : cannot convert parameter 1 from 'WCHAR *' to 'LPCSTR'"
dont use LPCSTR, but
CA2W()
Don't know where to start ?
Refer the Forums Guidelines and ask a friend -
ya project unicode aware , if i do't write LPCSTR it generate compile time error. "error C2664: 'CreateDirectoryA' : cannot convert parameter 1 from 'WCHAR *' to 'LPCSTR'"
manu
manu_2205 wrote:
'CreateDirectoryA
If your project is unicode aware, then how is the ANSI version of a function being called? Are you making a call explicitly to the
CreateDirectoryA()
or are you just callingCreateDirectory()
?manu_2205 wrote:
ya project unicode aware
Now what do you mean by this? Have you replaced
_MBCS
with_UNICODE
in the preprocessor definitions? ( project->settings->c/c++->preprocessor definitions )
Nobody can give you wiser advice than yourself. - Cicero ப்ரம்மா
-
Hi int result=CreateDirectory(LPCSTR(Dir_Name),NULL); The above statement return 0 if i use WCHAR pointer(Dir_Name). why ?
manu