Click here to Skip to main content
15,902,801 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to Get a TCHAR into a CString? Pin
toxcct7-May-08 4:54
toxcct7-May-08 4:54 
AnswerRe: How to Get a TCHAR into a CString? Pin
CPallini7-May-08 5:06
mveCPallini7-May-08 5:06 
QuestionRe: How to Get a TCHAR into a CString? Pin
David Crow7-May-08 5:26
David Crow7-May-08 5:26 
AnswerRe: How to Get a TCHAR into a CString? Pin
Randor 7-May-08 5:41
professional Randor 7-May-08 5:41 
AnswerRe: How to Get a TCHAR into a CString? Pin
Mark Salsbery7-May-08 6:52
Mark Salsbery7-May-08 6:52 
GeneralRe: How to Get a TCHAR into a CString? Pin
Larry Mills Sr7-May-08 7:34
Larry Mills Sr7-May-08 7:34 
GeneralRe: How to Get a TCHAR into a CString? Pin
CPallini7-May-08 7:42
mveCPallini7-May-08 7:42 
GeneralRe: How to Get a TCHAR into a CString? Pin
Mark Salsbery7-May-08 7:53
Mark Salsbery7-May-08 7:53 
Larry Mills Sr wrote:
You showed me yesturday to get a CString set for TChar you have to do so in it's constructor.


That was yesterday, and only to specifically get the file to open,
which I thought was the problem. That was a code example which hard-coded
a valid pathname so you could check your file handling code.

This string issue is entirely separate, and I'm not sure what problem you're
having at this point Smile | :) Compiler errors? Runtime errors? Step through with
the debugger (it's only a handful of lines of code) and watch the value of your
strings. If they're not doing what you want, then fix the code.

Larry Mills Sr wrote:
I'm not sure what David means by setting CString to UNICODE. How, exactly?


With visual studio projects, typically you just use the project/general/character set setting.
If you set this to use Unicode character set, then VS adds "/D "_UNICODE" /D "UNICODE"" to the compiler
command line. This defines two macros: _UNICODE and UNICODE. Now if you look at the header files
for CString(T) and TCHAR, you'll see that the definition of _UNICODE affects the character type
of those generic string types.


Larry Mills Sr wrote:
How will that setting effect SetWindowTextW(IDC_NAME,str);(where str is CString str) or GetWindowText(str);


You use a CString and that's it. Any method that takes a CString is already coded
to take generic strings into consideration. All you have to be concerned with is passing
the appropriate type. If a method expects a CString, then pass it a CString.


Mark

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: How to Get a TCHAR into a CString? Pin
Larry Mills Sr7-May-08 10:56
Larry Mills Sr7-May-08 10:56 
GeneralRe: How to Get a TCHAR into a CString? Pin
Mark Salsbery7-May-08 11:13
Mark Salsbery7-May-08 11:13 
GeneralRe: How to Get a TCHAR into a CString? Pin
Larry Mills Sr7-May-08 12:37
Larry Mills Sr7-May-08 12:37 
GeneralRe: How to Get a TCHAR into a CString? Pin
Mark Salsbery9-May-08 7:36
Mark Salsbery9-May-08 7:36 
AnswerRe: How to Get a TCHAR into a CString? Pin
Mark Salsbery9-May-08 7:47
Mark Salsbery9-May-08 7:47 
GeneralRe: How to Get a TCHAR into a CString? Pin
Larry Mills Sr9-May-08 16:05
Larry Mills Sr9-May-08 16:05 
QuestionToolbar in dialog based project Pin
ilgale7-May-08 4:28
ilgale7-May-08 4:28 
AnswerRe: Toolbar in dialog based project Pin
Mark Salsbery7-May-08 7:01
Mark Salsbery7-May-08 7:01 
QuestionCapturing a video using opencv on MFC Pin
Collin Xie7-May-08 4:18
Collin Xie7-May-08 4:18 
AnswerRe: Capturing a video using opencv on MFC Pin
srisuwan917-Jan-10 20:56
srisuwan917-Jan-10 20:56 
QuestionMFC Application and Web service Pin
BadJerry7-May-08 4:05
BadJerry7-May-08 4:05 
AnswerRe: MFC Application and Web service Pin
led mike7-May-08 4:28
led mike7-May-08 4:28 
GeneralRe: MFC Application and Web service Pin
BadJerry7-May-08 4:40
BadJerry7-May-08 4:40 
GeneralRe: MFC Application and Web service Pin
led mike7-May-08 5:05
led mike7-May-08 5:05 
AnswerRe: MFC Application and Web service Pin
Christopher Duncan7-May-08 14:20
Christopher Duncan7-May-08 14:20 
GeneralRe: MFC Application and Web service Pin
BadJerry7-May-08 23:13
BadJerry7-May-08 23:13 
GeneralRe: MFC Application and Web service Pin
Christopher Duncan8-May-08 6:04
Christopher Duncan8-May-08 6:04 

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.