Click here to Skip to main content
15,919,778 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalplease explain how the following C programs work Pin
suniluce0072-Jul-01 18:56
suniluce0072-Jul-01 18:56 
GeneralRe: please explain how the following C programs work Pin
Hadi Rezaee2-Jul-01 20:18
Hadi Rezaee2-Jul-01 20:18 
GeneralRe: please explain how the following C programs work Pin
Christian Graus2-Jul-01 23:09
protectorChristian Graus2-Jul-01 23:09 
GeneralRe: please explain how the following C programs work Pin
markkuk3-Jul-01 0:23
markkuk3-Jul-01 0:23 
GeneralSTL and UNICODE Pin
Nick Blumhardt2-Jul-01 17:19
Nick Blumhardt2-Jul-01 17:19 
GeneralRe: STL and UNICODE Pin
Michael Dunn2-Jul-01 18:52
sitebuilderMichael Dunn2-Jul-01 18:52 
GeneralRe: STL and UNICODE Pin
Nick Blumhardt2-Jul-01 19:11
Nick Blumhardt2-Jul-01 19:11 
GeneralRe: STL and UNICODE Pin
2-Jul-01 21:30
suss2-Jul-01 21:30 
One thing you need to be clear on - do you want to be able to create a single exe that works on both ASCII and UNICODE systems, or do you want to create a code base that can be compiled into an ASCII exe and a separate UNICODE exe ?

The entire 'TCHAR' concept that microsoft has developed is for creating a single set of source that can be compiled into both ASCII and UNICODE versions. If you are writing a program that will only be ASCII, or only UNICODE, or if you a writing a program that must be able to handle both, then the TCHAR style of coding is useless.

The TCHAR/typedef approach might seem like a good idea, but there are much more significant differences between ASCII and UNICODE code other than the size of the storage uhit (8 bit or 16 bit) - for example, upper/lower case conversion is completely different between ASCII and UNICODE, so a function like :

"void ToUpper(_tstring& input);"

is of limited value, since although it will compile into ASCII and UNICODE versions, it will probably only work correctly in one or the other!


In general, I have found that if Unicode is required, or likely to be needed, it's better just to write the entire program in std::wstring, and convert to/from ASCII(std::string) at the "edges".
GeneralRe: STL and UNICODE Pin
3-Jul-01 5:02
suss3-Jul-01 5:02 
GeneralRe: STL and UNICODE Pin
3-Jul-01 12:30
suss3-Jul-01 12:30 
GeneralRe: STL and UNICODE Pin
[James Pullicino]3-Jul-01 5:18
[James Pullicino]3-Jul-01 5:18 
Generalload image Pin
Kathrin2-Jul-01 16:08
Kathrin2-Jul-01 16:08 
GeneralRe: load image Pin
Christian Graus2-Jul-01 17:38
protectorChristian Graus2-Jul-01 17:38 
GeneralRe: load image Pin
Kathrin3-Jul-01 21:10
Kathrin3-Jul-01 21:10 
GeneralRe: load image Pin
Erik Thompson3-Jul-01 7:28
sitebuilderErik Thompson3-Jul-01 7:28 
GeneralRe: load image Pin
Kathrin3-Jul-01 22:00
Kathrin3-Jul-01 22:00 
GeneralRe: load image Pin
Erik Thompson4-Jul-01 7:24
sitebuilderErik Thompson4-Jul-01 7:24 
GeneralRe: load image Pin
Kathrin4-Jul-01 19:08
Kathrin4-Jul-01 19:08 
GeneralRe: load image Pin
Christian Graus4-Jul-01 19:15
protectorChristian Graus4-Jul-01 19:15 
Generalchange filename Pin
2-Jul-01 14:07
suss2-Jul-01 14:07 
GeneralRe: change filename Pin
Carlos Antollini2-Jul-01 14:56
Carlos Antollini2-Jul-01 14:56 
GeneralRe: change filename Pin
2-Jul-01 15:21
suss2-Jul-01 15:21 
GeneralRe: change filename Pin
3-Jul-01 5:22
suss3-Jul-01 5:22 
GeneralCOM IDL Pin
William Bartholomew2-Jul-01 12:42
William Bartholomew2-Jul-01 12:42 
GeneralRe: COM IDL Pin
Richard Caetano2-Jul-01 13:43
Richard Caetano2-Jul-01 13:43 

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.