Sorry about the platform specific code here, but I include to show what I am
doing. I am trying to create a char* directory listing.
If I compile the code below as Unicode then I get memory addresses in
strResponse. But it works fine if not compiled with Unicode. How would I
edit the code to work under Unicode?
WIN32_FIND_DATA stData;
//do first find call
HANDLE hReturn = ::FindFirstFile (TEXT("C:\\*.*" ), &stData);
if (hReturn == INVALID_HANDLE_ VALUE) return -1;
std::ostringstr eam ss;
ss << stData.cFileNam e << "\r\n";
while (::FindNextFile ( hReturn, &stData))
{
ss << stData.cFileNam e << "\r\n";
}
FindClose(hRetu rn);
std::string strResponse = ss.str();
stData.cFileNam e is a char buffer.
Angus
doing. I am trying to create a char* directory listing.
If I compile the code below as Unicode then I get memory addresses in
strResponse. But it works fine if not compiled with Unicode. How would I
edit the code to work under Unicode?
WIN32_FIND_DATA stData;
//do first find call
HANDLE hReturn = ::FindFirstFile (TEXT("C:\\*.*" ), &stData);
if (hReturn == INVALID_HANDLE_ VALUE) return -1;
std::ostringstr eam ss;
ss << stData.cFileNam e << "\r\n";
while (::FindNextFile ( hReturn, &stData))
{
ss << stData.cFileNam e << "\r\n";
}
FindClose(hRetu rn);
std::string strResponse = ss.str();
stData.cFileNam e is a char buffer.
Angus
Comment