Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi..

C++
hFind = FindFirstFile(DirPath1,&FindFileData);

Its Used to find the folders in the path...

the FindFileData.cFileName is TCHAR DataType..
i am coding under Unicode platform..

so i can't insert FindFileData.cFileName directly to string variable..

i have

C++
string s;

if i try

C++
s.insert(FindFileData.cFileName);

it producing error. what i want to do to rectify it..
Posted
Updated 20-Oct-11 22:25pm
v2

1 solution

If you're using unicode than TCHAR is defined as wchar_t. You should use std::wstring instead of std::string and all should be well:

wstring s;
s.insert(FindFileData.cFileName);
 
Share this answer
 
Comments
Philippe Mori 22-Oct-11 17:01pm    
Effectively... whevever possible an application should uses wide strings.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900