Click here to Skip to main content
15,911,139 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: LPCSTR and LPCWSTR Pin
David Crow20-Aug-07 17:45
David Crow20-Aug-07 17:45 
GeneralRe: LPCSTR and LPCWSTR Pin
George_George20-Aug-07 17:47
George_George20-Aug-07 17:47 
GeneralRe: LPCSTR and LPCWSTR Pin
David Crow21-Aug-07 3:13
David Crow21-Aug-07 3:13 
GeneralRe: LPCSTR and LPCWSTR Pin
George_George21-Aug-07 3:17
George_George21-Aug-07 3:17 
AnswerRe: LPCSTR and LPCWSTR Pin
Iain Clarke, Warrior Programmer20-Aug-07 5:41
Iain Clarke, Warrior Programmer20-Aug-07 5:41 
GeneralRe: LPCSTR and LPCWSTR Pin
George_George20-Aug-07 17:26
George_George20-Aug-07 17:26 
GeneralRe: LPCSTR and LPCWSTR Pin
George_George20-Aug-07 17:36
George_George20-Aug-07 17:36 
GeneralRe: LPCSTR and LPCWSTR Pin
Iain Clarke, Warrior Programmer21-Aug-07 0:02
Iain Clarke, Warrior Programmer21-Aug-07 0:02 
No idea, I don't use WCHAR. You'd have to look at the headers to see what's going on.

But I'd change the _T("Hello") to L"Hello". If *that* works, then _T is converting to ascii, and you haven't defined _UNICODE or UNICODE (I can never remember which is which, but one is for C, and one for Win32).

The reason you bother with _T is so that the code will be either ascii or unicode, depending on the defines. In which case, you should use TCHAR, as this varies similarly. If you're hard wiring for unicode, then you can write:

wchar_t *p = L"Hello";

instead.

You had a similar issue in another question to to with LPSTR/LPTSTR/LPWSTR. You need to make up your mind whether you're being ascii, dependent on defines, or full on unicode.

This mixing of hard wired and dependent-on-defines code is going to give you errors in both directions...

Iain
GeneralRe: LPCSTR and LPCWSTR Pin
George_George21-Aug-07 1:24
George_George21-Aug-07 1:24 
GeneralRe: LPCSTR and LPCWSTR Pin
Iain Clarke, Warrior Programmer21-Aug-07 3:29
Iain Clarke, Warrior Programmer21-Aug-07 3:29 
GeneralRe: LPCSTR and LPCWSTR Pin
George_George21-Aug-07 5:28
George_George21-Aug-07 5:28 
QuestionIDispatch to class object Pin
Monark20-Aug-07 4:54
Monark20-Aug-07 4:54 
AnswerRe: IDispatch to class object Pin
Mark Salsbery20-Aug-07 8:05
Mark Salsbery20-Aug-07 8:05 
QuestionTrouble with vectors. Newbie needs help! Pin
Flipflopninja20-Aug-07 4:49
Flipflopninja20-Aug-07 4:49 
AnswerRe: Trouble with vectors. Newbie needs help! Pin
Maxwell Chen20-Aug-07 5:05
Maxwell Chen20-Aug-07 5:05 
AnswerRe: Trouble with vectors. Newbie needs help! Pin
David Crow20-Aug-07 5:20
David Crow20-Aug-07 5:20 
AnswerRe: Trouble with vectors. Newbie needs help! [modified] Pin
Graham Shanks20-Aug-07 5:37
Graham Shanks20-Aug-07 5:37 
Questionfopen and wfopen Pin
George_George20-Aug-07 4:35
George_George20-Aug-07 4:35 
QuestionRe: fopen and wfopen Pin
David Crow20-Aug-07 4:39
David Crow20-Aug-07 4:39 
AnswerRe: fopen and wfopen Pin
George_George20-Aug-07 5:00
George_George20-Aug-07 5:00 
QuestionRe: fopen and wfopen Pin
David Crow20-Aug-07 5:18
David Crow20-Aug-07 5:18 
AnswerRe: fopen and wfopen Pin
George_George20-Aug-07 17:43
George_George20-Aug-07 17:43 
GeneralRe: fopen and wfopen Pin
David Crow21-Aug-07 2:55
David Crow21-Aug-07 2:55 
GeneralRe: fopen and wfopen Pin
George_George21-Aug-07 3:09
George_George21-Aug-07 3:09 
GeneralRe: fopen and wfopen Pin
David Crow21-Aug-07 3:21
David Crow21-Aug-07 3:21 

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.