Click here to Skip to main content
14,575,378 members

C / C++ / MFC

 
GeneralRe: [C++] Where to find coding examples and exercises? Pin
den2k882-Apr-20 6:49
professionalden2k882-Apr-20 6:49 
QuestionTCHAR vs built in char Pin
CalinNegru1-Apr-20 22:52
MemberCalinNegru1-Apr-20 22:52 
AnswerRe: TCHAR vs built in char Pin
den2k881-Apr-20 22:57
professionalden2k881-Apr-20 22:57 
GeneralRe: TCHAR vs built in char Pin
Richard MacCutchan1-Apr-20 23:50
mveRichard MacCutchan1-Apr-20 23:50 
GeneralRe: TCHAR vs built in char Pin
den2k881-Apr-20 23:55
professionalden2k881-Apr-20 23:55 
GeneralRe: TCHAR vs built in char Pin
Member 79891222-Apr-20 11:20
MemberMember 79891222-Apr-20 11:20 
GeneralRe: TCHAR vs built in char Pin
den2k882-Apr-20 21:15
professionalden2k882-Apr-20 21:15 
AnswerRe: TCHAR vs built in char Pin
leon de boer2-Apr-20 4:50
Memberleon de boer2-Apr-20 4:50 
The overwhelming use of it is when you want to use unicode but have the code portable for the none unicode situation.

It isn't just TCHAR you use in that situation but you place all string literals inside the _T() or TEXT() macros so they also port and use the TCHAR string functions _tcslen for strlen, _tcscpy_s for strcpy_s etc so all the string functions port.

So being precise about this on Visual Studio with a project open goto the last debug menu which is the project properties then goto

Configuration Properties->Advanced->Character Set you now have 3 options not set (aka use ansi), use unicode and use multi-byte wide character. When you use TCHAR and the above macros and stuff in <tchar.h> you can compile your code in any of those modes and it will work completely seamlessly.

I use it a lot because I write many multilingual windows applications which have large use in non English language areas.

It becomes second nature like using stdint.h and proper sized integers rather than int, short, long etc which are problematic porting.
In vino veritas


modified 2-Apr-20 10:59am.

GeneralRe: TCHAR vs built in char Pin
CalinNegru2-Apr-20 5:54
MemberCalinNegru2-Apr-20 5:54 
QuestionThanks for a new feature Pin
Anthony Appleyard31-Mar-20 4:14
MemberAnthony Appleyard31-Mar-20 4:14 
AnswerRe: Thanks for a new feature Pin
Richard MacCutchan31-Mar-20 4:33
mveRichard MacCutchan31-Mar-20 4:33 
GeneralRe: Thanks for a new feature Pin
ZurdoDev1-Apr-20 3:59
mveZurdoDev1-Apr-20 3:59 
AnswerRe: Thanks for a new feature Pin
ZurdoDev1-Apr-20 3:59
mveZurdoDev1-Apr-20 3:59 
QuestionGetting 2203 error while doing silent installation of MSI Pin
Vijay53330-Mar-20 3:34
MemberVijay53330-Mar-20 3:34 
AnswerRe: Getting 2203 error while doing silent installation of MSI Pin
Richard MacCutchan30-Mar-20 3:36
mveRichard MacCutchan30-Mar-20 3:36 
AnswerRe: Getting 2203 error while doing silent installation of MSI Pin
Dave Kreskowiak30-Mar-20 3:51
mveDave Kreskowiak30-Mar-20 3:51 
GeneralRe: Getting 2203 error while doing silent installation of MSI Pin
Vijay53331-Mar-20 0:33
MemberVijay53331-Mar-20 0:33 
GeneralRe: Getting 2203 error while doing silent installation of MSI Pin
Dave Kreskowiak31-Mar-20 4:55
mveDave Kreskowiak31-Mar-20 4:55 
QuestionFinding a directory Pin
Anthony Appleyard29-Mar-20 18:32
MemberAnthony Appleyard29-Mar-20 18:32 
AnswerRe: Finding a directory Pin
leon de boer29-Mar-20 20:26
Memberleon de boer29-Mar-20 20:26 
QuestionPassing an array as argument to a function Pin
CalinNegru28-Mar-20 22:15
MemberCalinNegru28-Mar-20 22:15 
AnswerRe: Passing an array as argument to a function Pin
Richard MacCutchan28-Mar-20 22:34
mveRichard MacCutchan28-Mar-20 22:34 
GeneralRe: Passing an array as argument to a function Pin
CalinNegru28-Mar-20 22:59
MemberCalinNegru28-Mar-20 22:59 
GeneralRe: Passing an array as argument to a function Pin
Richard MacCutchan28-Mar-20 23:23
mveRichard MacCutchan28-Mar-20 23:23 
GeneralRe: Passing an array as argument to a function Pin
CalinNegru28-Mar-20 23:44
MemberCalinNegru28-Mar-20 23:44 

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.