Click here to Skip to main content
15,889,861 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionReadFile/WriteFile returning ERROR_INVALID_FUNCTION on USB device on Vista Pin
Keith Worden12-Feb-09 5:12
Keith Worden12-Feb-09 5:12 
AnswerRe: ReadFile/WriteFile returning ERROR_INVALID_FUNCTION on USB device on Vista Pin
Stuart Dootson12-Feb-09 6:59
professionalStuart Dootson12-Feb-09 6:59 
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 
You are using pointers to TCHAR as the string, in effect, not arrays. Arrays are funny things in C and C++ - they're really just pointers in drag.

Anyway, you're better off using a string class, like std::basic_string<TCHAR>, because it already defines comparison operations that std::map needs, whereas a TCHAR* doesn't.

Something like this should work:

typedef std::basic_string<TCHAR> tstring;
typedef std::map<tstring, MyStruct> MyStructMap;
MyStructMap objStructMap;

objStructMap.insert(std::make_pair(_T("Unique1"),  structobj1));


Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

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 
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 

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.