Click here to Skip to main content
15,911,039 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ReadFile/WriteFile returning ERROR_INVALID_FUNCTION on USB device on Vista Pin
Keith Worden13-Feb-09 0:06
Keith Worden13-Feb-09 0:06 
GeneralRe: ReadFile/WriteFile returning ERROR_INVALID_FUNCTION on USB device on Vista Pin
Stuart Dootson13-Feb-09 0:17
professionalStuart Dootson13-Feb-09 0:17 
QuestionTCHAR as Key in a map. Pin
Comp_Users12-Feb-09 1:28
Comp_Users12-Feb-09 1:28 
GeneralRe: TCHAR as Key in a map. Pin
liangyenchyen12-Feb-09 1:40
liangyenchyen12-Feb-09 1:40 
GeneralRe: TCHAR as Key in a map. Pin
Comp_Users12-Feb-09 2:05
Comp_Users12-Feb-09 2:05 
AnswerRe: TCHAR as Key in a map. Pin
Stuart Dootson12-Feb-09 2:23
professionalStuart Dootson12-Feb-09 2:23 
GeneralRe: TCHAR as Key in a map. Pin
Comp_Users12-Feb-09 3:26
Comp_Users12-Feb-09 3:26 
AnswerRe: TCHAR as Key in a map. Pin
Cedric Moonen12-Feb-09 2:27
Cedric Moonen12-Feb-09 2:27 
First, you have to insert the < and > symbols yourself using the buttons just above the emoticons, oyherwise they will disappear.

Next, why don't you use a std::string or std::wstring to do that ? It will make your life way much easier. The map will rely on fact that the objects you provide as a key are comparable, which is not the case with C strings (what will be compared is the pointer address, not the contents). Thus this will simply not work. The other reply you got was simply to say that you can get over it by providing your own structure which overrides the == operator.

But, it is making your life complicated. If I were you, I would simply use the std::string (in non unicode build) or std::wstring (in UNICODE build) for that. If you have to support both builds, then simply define your own type:

#if defined _UNICODE || defined UNICODE
	typedef std::wstring TMyString;
#else
	typedef std::string TMyString;
#endif


Cédric Moonen
Software developer

Charting control [v1.5]
OpenGL game tutorial in C++

AnswerRe: TCHAR as Key in a map. Pin
Eytukan12-Feb-09 2:58
Eytukan12-Feb-09 2:58 
QuestionEclipse C++ Project references Pin
gvanto12-Feb-09 1:07
gvanto12-Feb-09 1:07 
AnswerRe: Eclipse C++ Project references Pin
Stuart Dootson12-Feb-09 2:11
professionalStuart Dootson12-Feb-09 2:11 
AnswerRe: Eclipse C++ Project references Pin
CPallini12-Feb-09 2:17
mveCPallini12-Feb-09 2:17 
GeneralRe: Eclipse C++ Project references [modified] Pin
gvanto12-Feb-09 12:16
gvanto12-Feb-09 12:16 
AnswerRe: Eclipse C++ Project references Pin
gvanto12-Feb-09 13:31
gvanto12-Feb-09 13:31 
Questionmessage loop + event Pin
Vlasta_12-Feb-09 0:16
Vlasta_12-Feb-09 0:16 
AnswerRe: message loop + event Pin
Stuart Dootson12-Feb-09 0:33
professionalStuart Dootson12-Feb-09 0:33 
AnswerRe: message loop + event Pin
Stephen Hewitt12-Feb-09 0:44
Stephen Hewitt12-Feb-09 0:44 
AnswerRe: message loop + event Pin
Vlasta_12-Feb-09 1:46
Vlasta_12-Feb-09 1:46 
QuestionBest sleep() method in while loop? Pin
notiter12-Feb-09 0:15
notiter12-Feb-09 0:15 
AnswerRe: Best sleep() method in while loop? Pin
_AnsHUMAN_ 12-Feb-09 0:26
_AnsHUMAN_ 12-Feb-09 0:26 
AnswerRe: Best sleep() method in while loop? Pin
Eytukan12-Feb-09 0:38
Eytukan12-Feb-09 0:38 
AnswerRe: Best sleep() method in while loop? Pin
Roger Stoltz12-Feb-09 1:30
Roger Stoltz12-Feb-09 1:30 
GeneralRe: Best sleep() method in while loop? Pin
Eytukan12-Feb-09 2:25
Eytukan12-Feb-09 2:25 
GeneralRe: Best sleep() method in while loop? Pin
Roger Stoltz12-Feb-09 2:40
Roger Stoltz12-Feb-09 2:40 
AnswerRe: Best sleep() method in while loop? Pin
Rajesh R Subramanian12-Feb-09 3:33
professionalRajesh R Subramanian12-Feb-09 3:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.