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

C / C++ / MFC

 
GeneralUrgent Exception in GetString of ADODB.Recordsset Pin
Alpesh10-Jan-01 1:24
Alpesh10-Jan-01 1:24 
GeneralSound Pin
10-Jan-01 0:58
suss10-Jan-01 0:58 
QuestionCListCtrl and noresize columns ???? Pin
10-Jan-01 0:33
suss10-Jan-01 0:33 
AnswerRe: CListCtrl and noresize columns ???? Pin
10-Jan-01 21:50
suss10-Jan-01 21:50 
QuestionActiveX controls belong in Doc or View? Pin
Brendan Tregear9-Jan-01 11:01
Brendan Tregear9-Jan-01 11:01 
AnswerRe: ActiveX controls belong in Doc or View? Pin
Erik Funkenbusch9-Jan-01 12:20
Erik Funkenbusch9-Jan-01 12:20 
Generalstd::string and unicode Pin
Anders Molin9-Jan-01 8:52
professionalAnders Molin9-Jan-01 8:52 
GeneralRe: std::string and unicode Pin
Chad Plautz9-Jan-01 9:32
Chad Plautz9-Jan-01 9:32 
The following is based on Microsoft's version of STL included in MSVC 6.0 SP3.

std::string is really just the definition std::basic_string<char> and std::wstring is std::basic_string<wchar_t>. If you want a TCHAR version you will have to declare your own as I have not found support for it directly: So in a header file you can define

#include <tchar.h>
#include <string>

using std::basic_string;

basic_string<tchar> tstring;

Then use tstring where you would use string 's or wstring 's. TCHAR will be preprocessed into the proper version for you.

Of course, you can apply this to all the character based STL using the 'basic_*' template definitions.
For example:
A build specific version of cout could be:

basic_ostream<tchar> tout;

It is up to you if you want to add these to the std namespace or your own. But it would not take much to create a header file that defines all character related stl classes in this manner. However, there are some interface functions that do not use the char_traits<> template (such as basic_ifstream::open which takes a const char * for the name of the file to open) so just be aware of these.

Good luck,

Chad
GeneralRe: std::string and unicode Pin
Chad Plautz9-Jan-01 9:38
Chad Plautz9-Jan-01 9:38 
GeneralRe: std::string and unicode Pin
Anders Molin9-Jan-01 21:02
professionalAnders Molin9-Jan-01 21:02 
QuestionHow do I force my program to check the message queue? Pin
Paul Auger9-Jan-01 6:35
Paul Auger9-Jan-01 6:35 
AnswerRe: How do I force my program to check the message queue? Pin
9-Jan-01 7:10
suss9-Jan-01 7:10 
GeneralCWnd - HWnd Map Related problem Pin
9-Jan-01 2:54
suss9-Jan-01 2:54 
GeneralHICON to .ico File Pin
8-Jan-01 23:17
suss8-Jan-01 23:17 
Questionhow to display a GIF image by programming? Pin
8-Jan-01 20:02
suss8-Jan-01 20:02 
AnswerRe: how to display a GIF image by programming? Pin
Jim Howard9-Jan-01 7:52
Jim Howard9-Jan-01 7:52 
GeneralRe: how to display a GIF image by programming? Pin
Marc Richarme9-Jan-01 9:01
Marc Richarme9-Jan-01 9:01 
GeneralRe: how to display a GIF image by programming? Pin
Christian Graus9-Jan-01 9:23
protectorChristian Graus9-Jan-01 9:23 
GeneralRe: how to display a GIF image by programming? Pin
Masoud Samimi9-Jan-01 9:59
Masoud Samimi9-Jan-01 9:59 
GeneralRe: how to display a GIF image by programming? Pin
Christian Graus9-Jan-01 13:14
protectorChristian Graus9-Jan-01 13:14 
GeneralRe: how to display a GIF image by programming? Pin
Masoud Samimi9-Jan-01 23:53
Masoud Samimi9-Jan-01 23:53 
AnswerRe: how to display a GIF image by programming? Pin
Juan Carlos Cobas9-Jan-01 10:23
Juan Carlos Cobas9-Jan-01 10:23 
Answerthank you very much Pin
9-Jan-01 22:57
suss9-Jan-01 22:57 
AnswerHere is the BEEF! (Animated GIF) :-) ( Was: how to display a GIF image by programming?) Pin
Masoud Samimi10-Jan-01 1:33
Masoud Samimi10-Jan-01 1:33 
GeneralRe: Here is the BEEF! (Animated GIF) :-) ( Was: how to display a GIF image by programming?) Pin
Masoud Samimi10-Jan-01 2:33
Masoud Samimi10-Jan-01 2: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.