A
Angus
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:stringstream ss;
ss << stData.cFileName << "\r\n";
while :FindNextFile( hReturn, &stData))
{
ss << stData.cFileName << "\r\n";
}
FindClose(hReturn);
std::string strResponse = ss.str();
stData.cFileName 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:stringstream ss;
ss << stData.cFileName << "\r\n";
while :FindNextFile( hReturn, &stData))
{
ss << stData.cFileName << "\r\n";
}
FindClose(hReturn);
std::string strResponse = ss.str();
stData.cFileName is a char buffer.
Angus