dsmey
2009-10-22 18:09:18 UTC
Hi all,
Just updated from CBuilder 2006 to 2009. I've got a junky little app
that moves files around and renames them. But, now it won't compile.
The line:
CopyFile(Alist->Strings[i].c_str(), filename.c_str(), false);
throws the error Cannot convert 'wchar_t *' to 'const char *'
Alist is a StringList and filename is an AnsiString
So it looks like I need some basic string help. My AnsiStrings are
now widestrings? Or only after I call the .c_str() method?
To make it more confusing, using CopyFileA gives error Cannot convert
wchar_t * to const char *, but using CopyFileW give Cannot convert
char * to const wchar_t * (which is the exact opposite)?
Any help would be appreciated.
Just updated from CBuilder 2006 to 2009. I've got a junky little app
that moves files around and renames them. But, now it won't compile.
The line:
CopyFile(Alist->Strings[i].c_str(), filename.c_str(), false);
throws the error Cannot convert 'wchar_t *' to 'const char *'
Alist is a StringList and filename is an AnsiString
So it looks like I need some basic string help. My AnsiStrings are
now widestrings? Or only after I call the .c_str() method?
To make it more confusing, using CopyFileA gives error Cannot convert
wchar_t * to const char *, but using CopyFileW give Cannot convert
char * to const wchar_t * (which is the exact opposite)?
Any help would be appreciated.