Click here to Skip to main content
15,888,454 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Modeless Dialog in MDI app Pin
Nibu babu thomas19-Jul-06 3:05
Nibu babu thomas19-Jul-06 3:05 
GeneralRe: Modeless Dialog in MDI app Pin
eusto19-Jul-06 7:05
eusto19-Jul-06 7:05 
GeneralRe: Modeless Dialog in MDI app [modified] Pin
eusto19-Jul-06 3:06
eusto19-Jul-06 3:06 
GeneralRe: Modeless Dialog in MDI app Pin
Nibu babu thomas19-Jul-06 19:44
Nibu babu thomas19-Jul-06 19:44 
GeneralRe: Modeless Dialog in MDI app Pin
eusto19-Jul-06 21:52
eusto19-Jul-06 21:52 
QuestionDrawString(GDI+) & CString Pin
NoName II10-Jul-06 22:45
NoName II10-Jul-06 22:45 
GeneralRe: DrawString(GDI+) & CString Pin
Parthi_Appu10-Jul-06 23:00
Parthi_Appu10-Jul-06 23:00 
AnswerRe: DrawString(GDI+) & CString Pin
Mike Dimmick11-Jul-06 0:10
Mike Dimmick11-Jul-06 0:10 
There's no need to use GetBuffer, you can simply pass the CString object, if it's the right width. I suspect you're compiling without UNICODE defined, so your CString is actually a CStringA, which does not have a conversion operator to const WCHAR*. It stores byte-oriented national character set characters. GDI+ expects UTF-16 Unicode characters. You need to either store your strings in this format, or convert them when you need to use them.

Unless you want compatibility with Windows 9x, the easiest thing to do is to simply define UNICODE and _UNICODE, or select the 'Unicode' configuration if you already have one. You need to define both macros because the Windows headers use UNICODE while the C run-time uses _UNICODE. This forces all CString objects to be UTF-16 Unicode. You'll have to fix any compile errors you get here, where you've used a string not wrapped in _T().

Slightly more difficult is to store any strings you want to display on screen in the correct format. Here you should consider using CStringW objects (I'm assuming you're using at least MFC 7.0 from Visual Studio .NET 2002, rather than MFC 6.0). You can construct a CStringW from byte-oriented national character set data (char*). You can convert at the point of use if necessary. Using CStringW is slightly more straightforward than trying to use the MultiByteToWideChar API directly.

If explicitly using the wchar_t, WCHAR or CStringW datatypes, you should use the L"" syntax to specify your string literals, rather than _T(). Only use _T() for values that should change format depending on whether _UNICODE is defined.

Stability. What an interesting concept. -- Chris Maunder
Questioncan't use CPropertySheet constructor??? Pin
NoName II10-Jul-06 22:41
NoName II10-Jul-06 22:41 
AnswerRe: can't use CPropertySheet constructor??? Pin
Mike Dimmick11-Jul-06 0:12
Mike Dimmick11-Jul-06 0:12 
QuestionAdding new font Pin
Semion_N10-Jul-06 22:18
Semion_N10-Jul-06 22:18 
AnswerRe: Adding new font Pin
Monty210-Jul-06 22:27
Monty210-Jul-06 22:27 
GeneralRe: Adding new font Pin
Semion_N11-Jul-06 3:34
Semion_N11-Jul-06 3:34 
QuestionPrinting Document Pin
Ganesh_T10-Jul-06 21:52
Ganesh_T10-Jul-06 21:52 
AnswerRe: Printing Document Pin
Hamid_RT10-Jul-06 22:03
Hamid_RT10-Jul-06 22:03 
GeneralRe: Printing Document Pin
Ganesh_T10-Jul-06 22:39
Ganesh_T10-Jul-06 22:39 
GeneralRe: Printing Document Pin
Hamid_RT11-Jul-06 0:28
Hamid_RT11-Jul-06 0:28 
GeneralRe: Printing Document Pin
Ganesh_T11-Jul-06 1:04
Ganesh_T11-Jul-06 1:04 
AnswerRe: Printing Document Pin
Monty210-Jul-06 22:33
Monty210-Jul-06 22:33 
GeneralRe: Printing Document [modified] Pin
Ganesh_T10-Jul-06 22:40
Ganesh_T10-Jul-06 22:40 
GeneralRe: Printing Document Pin
Monty210-Jul-06 22:55
Monty210-Jul-06 22:55 
Questiondetecting frame change in video Pin
Ram Murali10-Jul-06 21:46
Ram Murali10-Jul-06 21:46 
QuestionCTreeCtrl question Pin
zeus_master10-Jul-06 21:45
zeus_master10-Jul-06 21:45 
AnswerRe: CTreeCtrl question Pin
Hamid_RT10-Jul-06 21:47
Hamid_RT10-Jul-06 21:47 
AnswerRe: CTreeCtrl question Pin
Abhi Lahare10-Jul-06 21:52
Abhi Lahare10-Jul-06 21:52 

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.