Click here to Skip to main content
16,011,608 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHelp with _tioa and other conversion routines Pin
Larry Mills Sr2-Jul-08 12:51
Larry Mills Sr2-Jul-08 12:51 
AnswerRe: Help with _tioa and other conversion routines Pin
Saurabh.Garg2-Jul-08 16:45
Saurabh.Garg2-Jul-08 16:45 
GeneralRe: Help with _tioa and other conversion routines Pin
Larry Mills Sr2-Jul-08 17:26
Larry Mills Sr2-Jul-08 17:26 
GeneralRe: Help with _tioa and other conversion routines Pin
Saurabh.Garg2-Jul-08 17:39
Saurabh.Garg2-Jul-08 17:39 
GeneralRe: Help with _tioa and other conversion routines Pin
Larry Mills Sr3-Jul-08 3:55
Larry Mills Sr3-Jul-08 3:55 
AnswerRe: Help with _tioa and other conversion routines Pin
beko2-Jul-08 19:55
beko2-Jul-08 19:55 
GeneralRe: Help with _tioa and other conversion routines Pin
Larry Mills Sr3-Jul-08 4:10
Larry Mills Sr3-Jul-08 4:10 
GeneralRe: Help with _tioa and other conversion routines Pin
Mark Salsbery3-Jul-08 7:04
Mark Salsbery3-Jul-08 7:04 
That should be:
CString tmp;
int a = 5;
tmp.Format(_T("%d Hey "), a);


Here's a tip:
Choose a string character type and stick with it.
The three common choices are
char (ANSI)
wchar_t (Unicode)
TCHAR (Generic - either char or wchar_t based on build configuration)

MFC uses generic types and, except for OLD APIs, so does Windows, so if you're using MFC,
generic is probably the best choice - unless you want to have to conver strings every
time you call a Windows or MFC API.

CString is also a generic type - it's either a CStringA (ANSI/char) or
CStringW (Unicode/wchar_t) depending on the build configuration.

If you choose to use the generic types, use them everywhere.
That means:
Use the Generic Text Mappings[^]
Wrap your string literals with the _T() macro
Use CSring instead of CStringA or CStringW

IMO, this stuff should be second-nature. You shouldn't have to think about it.
It's VERY worthwhile to take the time to understand it completely.

Mark

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: Help with _tioa and other conversion routines Pin
Larry Mills Sr3-Jul-08 9:04
Larry Mills Sr3-Jul-08 9:04 
Question'strptime': identifier not found, even with argument-dependent lookup Pin
dinesh_shads2-Jul-08 12:02
dinesh_shads2-Jul-08 12:02 
AnswerRe: 'strptime': identifier not found, even with argument-dependent lookup Pin
dinesh_shads2-Jul-08 12:04
dinesh_shads2-Jul-08 12:04 
AnswerRe: 'strptime': identifier not found, even with argument-dependent lookup Pin
Saurabh.Garg2-Jul-08 16:50
Saurabh.Garg2-Jul-08 16:50 
QuestionAccelerator Key Pin
Anthony98872-Jul-08 9:54
Anthony98872-Jul-08 9:54 
AnswerRe: Accelerator Key Pin
Nelek3-Jul-08 22:08
protectorNelek3-Jul-08 22:08 
QuestionC++ program help counting frequency of char. entered. Pin
michael12012-Jul-08 9:10
michael12012-Jul-08 9:10 
AnswerRe: C++ program help counting frequency of char. entered. Pin
Maximilien2-Jul-08 9:33
Maximilien2-Jul-08 9:33 
GeneralRe: C++ program help counting frequency of char. entered. Pin
led mike2-Jul-08 9:49
led mike2-Jul-08 9:49 
GeneralRe: C++ program help counting frequency of char. entered. Pin
CPallini2-Jul-08 10:07
mveCPallini2-Jul-08 10:07 
GeneralRe: C++ program help counting frequency of char. entered. Pin
Mark Salsbery2-Jul-08 10:51
Mark Salsbery2-Jul-08 10:51 
AnswerRe: C++ program help counting frequency of char. entered. Pin
David Crow2-Jul-08 9:51
David Crow2-Jul-08 9:51 
AnswerRe: C++ program help counting frequency of char. entered. Pin
CPallini2-Jul-08 9:59
mveCPallini2-Jul-08 9:59 
AnswerRe: C++ program help counting frequency of char. entered. Pin
Bram van Kampen2-Jul-08 12:28
Bram van Kampen2-Jul-08 12:28 
Questionabout Win32 DLL Pin
zhoogle2-Jul-08 21:42
zhoogle2-Jul-08 21:42 
AnswerRe: about Win32 DLL Pin
Iain Clarke, Warrior Programmer2-Jul-08 23:11
Iain Clarke, Warrior Programmer2-Jul-08 23:11 
GeneralRe: about Win32 DLL Pin
Bram van Kampen3-Jul-08 0:32
Bram van Kampen3-Jul-08 0:32 

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.