Click here to Skip to main content
15,896,154 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDrawText is giving me garbage Pin
thebeekeeper9-Sep-08 5:16
thebeekeeper9-Sep-08 5:16 
AnswerRe: DrawText is giving me garbage Pin
Mark Salsbery9-Sep-08 5:30
Mark Salsbery9-Sep-08 5:30 
GeneralRe: DrawText is giving me garbage Pin
thebeekeeper9-Sep-08 5:37
thebeekeeper9-Sep-08 5:37 
GeneralRe: DrawText is giving me garbage Pin
Mark Salsbery9-Sep-08 5:45
Mark Salsbery9-Sep-08 5:45 
GeneralRe: DrawText is giving me garbage Pin
thebeekeeper9-Sep-08 6:09
thebeekeeper9-Sep-08 6:09 
GeneralRe: DrawText is giving me garbage Pin
Mark Salsbery9-Sep-08 6:22
Mark Salsbery9-Sep-08 6:22 
GeneralRe: DrawText is giving me garbage Pin
thebeekeeper9-Sep-08 6:36
thebeekeeper9-Sep-08 6:36 
GeneralRe: DrawText is giving me garbage Pin
Mark Salsbery9-Sep-08 7:09
Mark Salsbery9-Sep-08 7:09 
thebeekeeper wrote:
it's coming out of std::string c_str(), so it's a const char*. There's no way that can be Unicode, right?


Right, but a deeper question is why are you using a string
type hardwired to char in a Unicode environment?

I recommend using generic string types everywhere in
an MFC app. MFC does, so it works out nice when we do.
Using all generics makes any code you write compilable in
both Unicode and non-Unicode builds, just like MFC. Plus
you don't need to do all those string conversions, which are
inefficient.

If you must use STL strings, you could make your own generic
string class:
typedef std::basic_string<TCHAR, char_traits<TCHAR>,
	allocator<TCHAR>>  genericstdstring;

Use genericstdstring in place of std::string.



thebeekeeper wrote:
but I copied that code from MSDN, so it can't be wrong


Umm...if you say so Smile | :)

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: DrawText is giving me garbage Pin
thebeekeeper9-Sep-08 6:59
thebeekeeper9-Sep-08 6:59 
GeneralRe: DrawText is giving me garbage Pin
Mark Salsbery9-Sep-08 7:17
Mark Salsbery9-Sep-08 7:17 
GeneralRe: DrawText is giving me garbage Pin
Mark Salsbery9-Sep-08 7:19
Mark Salsbery9-Sep-08 7:19 
GeneralRe: DrawText is giving me garbage Pin
thebeekeeper9-Sep-08 7:25
thebeekeeper9-Sep-08 7:25 
GeneralRe: DrawText is giving me garbage Pin
Mark Salsbery9-Sep-08 7:31
Mark Salsbery9-Sep-08 7:31 
QuestionRe: DrawText is giving me garbage Pin
led mike9-Sep-08 5:32
led mike9-Sep-08 5:32 
QuestionEmbedded Data Pin
claman9-Sep-08 5:05
claman9-Sep-08 5:05 
JokeRe: Embedded Data Pin
CPallini9-Sep-08 5:35
mveCPallini9-Sep-08 5:35 
JokeRe: Embedded Data Pin
toxcct9-Sep-08 5:43
toxcct9-Sep-08 5:43 
JokeRe: Embedded Data Pin
enhzflep9-Sep-08 5:47
enhzflep9-Sep-08 5:47 
JokeRe: Embedded Data Pin
Perspx9-Sep-08 6:12
Perspx9-Sep-08 6:12 
JokeRe: Embedded Data Pin
CPallini9-Sep-08 6:13
mveCPallini9-Sep-08 6:13 
GeneralRe: Embedded Data Pin
Hamid_RT9-Sep-08 8:21
Hamid_RT9-Sep-08 8:21 
QuestionRe: Embedded Data Pin
CPallini9-Sep-08 9:30
mveCPallini9-Sep-08 9:30 
AnswerRe: Embedded Data Pin
Hamid_RT9-Sep-08 20:32
Hamid_RT9-Sep-08 20:32 
GeneralRe: Embedded Data Pin
CPallini9-Sep-08 21:06
mveCPallini9-Sep-08 21:06 
GeneralRe: Embedded Data Pin
Hamid_RT10-Sep-08 0:44
Hamid_RT10-Sep-08 0: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.