Re: CString not working as advertised



Mark,

Thanks for the help. Changing the project settings so that they didn't
specify UNICODE did the trick.

Chris

In article <#jkRTX#YGHA.1192@xxxxxxxxxxxxxxxxxxxx>, mark
[__OKTHISISFAKE_]yr@xxxxxxxxxxxxxxxxxxxxxxxxxxx says...
const char* is not what CString has by default in 2005, its const wchar_t*.

Use CStringA (for ASCII, and hence char*) or CStringW (for UNICODE, and
hence wchar_t* ).

If you want to write apps that easily change (why?) then use CString and it
will change between CStringA and CStringW depending upon the UNICODE project
settings (instead of mbcs).


.



Relevant Pages

  • Re: Does any one ever use function capFileSaveDIB?
    ... Windows treats szName as a constant string, so you should be able to pass ... plain old CString in ANSI programs or CStringA in either ANSI or Unicode. ... you should have a LPTSTR not LPSTR. ... I don't agree neither with casting to LPSTR nor with using CStringA. ...
    (microsoft.public.vc.mfc)
  • Re: Converting CString to char*
    ... I have eliminated the problem by changing everything to const char*, ... impliment unicode support at this point in time - should I ever need to. ... >> Would using CStringA be any better? ...
    (microsoft.public.vc.mfc)
  • Re: How to convert 2 WCHAR to 1 WCHAR
    ... Unicode would have been good; the error is in the W2A macro. ... Assuming here processing and comparing CStringA or std::string is more ... How is this character stored in your input string? ... single WCHAR, in this particular case? ...
    (microsoft.public.vc.mfc)
  • Re: If I could.. another MFC / UNicode question
    ... I suppose I have to determine the input files' ... quote me - my memory is like a sieve) if it is Unicode. ... you can use CStringA and CStringW explicitly for reading ... Author MOZART the music processor for Windows - ...
    (microsoft.public.vc.mfc)
  • Re: If I could.. another MFC / UNicode question
    ... I suppose I have to determine the input files' mode ... quote me - my memory is like a sieve) if it is Unicode. ... you can use CStringA and CStringW explicitly for reading the ... Author MOZART the music processor for Windows - ...
    (microsoft.public.vc.mfc)