c++ - Wchar_t to string Convertion -
i want convert strfilenotifyinfo[1].filename(wchar_t) string can see filepath. can't create work.
here code:
while(true) { if( readdirectorychangesw( hdir, (lpvoid)&strfilenotifyinfo, sizeof(strfilenotifyinfo), false, file_notify_change_last_write || file_notify_change_creation, &dwbytesreturned, null, null) == 0) { cout << "reading directory change" << endl; } else { cout << ("file modified: ") << strfilenotifyinfo[1].filename << endl; cout << ("loop: ") << ncounter++ << endl; } }
use wcout
when working wide character data.
std::wcout << l"file modified: " << strfilenotifyinfo[1].filename << std::endl;
c++ string wchar readdirectorychangesw
No comments:
Post a Comment