Click here to Skip to main content
14,357,792 members

C / C++ / MFC

 
AnswerRe: CString to const char* Pin
Victor Nijegorodov29-Aug-19 23:55
memberVictor Nijegorodov29-Aug-19 23:55 
GeneralRe: CString to const char* Pin
_Flaviu30-Aug-19 0:08
member_Flaviu30-Aug-19 0:08 
GeneralRe: CString to const char* Pin
_Flaviu30-Aug-19 0:31
member_Flaviu30-Aug-19 0:31 
GeneralRe: CString to const char* Pin
Victor Nijegorodov30-Aug-19 0:40
memberVictor Nijegorodov30-Aug-19 0:40 
GeneralRe: CString to const char* Pin
_Flaviu30-Aug-19 0:56
member_Flaviu30-Aug-19 0:56 
GeneralRe: CString to const char* Pin
Victor Nijegorodov30-Aug-19 1:08
memberVictor Nijegorodov30-Aug-19 1:08 
GeneralRe: CString to const char* Pin
_Flaviu30-Aug-19 1:17
member_Flaviu30-Aug-19 1:17 
GeneralRe: CString to const char* Pin
Victor Nijegorodov30-Aug-19 1:26
memberVictor Nijegorodov30-Aug-19 1:26 
_Flaviu wrote:
for the second try, I got an error:
1>d:\tempx\test\testdoc.cpp(53): error C2440: 'type cast' : cannot convert from 'CString' to 'LPCSTR'
at
CString someText("Test");
ansi = (LPCSTR)someText;    // <-- here is the error
TRACE("%s\n", ansi);
The project is unicode.
Of course you get the error since the CString contains the wide char text!
Either change the build to be MBCS/ANSI or convert CString to wchar_t* (or use _T() macro).

GeneralRe: CString to const char* Pin
_Flaviu30-Aug-19 2:06
member_Flaviu30-Aug-19 2:06 
GeneralRe: CString to const char* Pin
Richard MacCutchan30-Aug-19 3:40
protectorRichard MacCutchan30-Aug-19 3:40 
QuestionRe: CString to const char* Pin
David Crow10-Sep-19 5:32
memberDavid Crow10-Sep-19 5:32 
GeneralRe: CString to const char* Pin
_Flaviu30-Aug-19 1:02
member_Flaviu30-Aug-19 1:02 
GeneralRe: CString to const char* Pin
Richard MacCutchan30-Aug-19 1:57
protectorRichard MacCutchan30-Aug-19 1:57 
Questioncpplinq - How to use the aggregate function - Get longest string a string array Pin
Mc_Topaz27-Aug-19 23:24
memberMc_Topaz27-Aug-19 23:24 
AnswerRe: cpplinq - How to use the aggregate function - Get longest string a string array Pin
Graham Breach28-Aug-19 0:13
memberGraham Breach28-Aug-19 0:13 
GeneralRe: cpplinq - How to use the aggregate function - Get longest string a string array Pin
Mc_Topaz28-Aug-19 0:35
memberMc_Topaz28-Aug-19 0:35 
Questionerror LNK2019 Pin
_Flaviu27-Aug-19 2:03
member_Flaviu27-Aug-19 2:03 
AnswerRe: error LNK2019 Pin
Richard MacCutchan27-Aug-19 2:25
protectorRichard MacCutchan27-Aug-19 2:25 
AnswerRe: error LNK2019 Pin
phil.o27-Aug-19 3:12
mvephil.o27-Aug-19 3:12 
GeneralRe: error LNK2019 Pin
Richard MacCutchan27-Aug-19 5:31
protectorRichard MacCutchan27-Aug-19 5:31 
AnswerRe: error LNK2019 Pin
Stefan_Lang29-Aug-19 22:56
memberStefan_Lang29-Aug-19 22:56 
GeneralRe: error LNK2019 Pin
_Flaviu29-Aug-19 23:09
member_Flaviu29-Aug-19 23:09 
Questionwarning LNK4099: PDB 'utils.pdb' was not found Pin
_Flaviu26-Aug-19 23:14
member_Flaviu26-Aug-19 23:14 
AnswerRe: warning LNK4099: PDB 'utils.pdb' was not found Pin
Richard MacCutchan26-Aug-19 23:44
protectorRichard MacCutchan26-Aug-19 23:44 
GeneralRe: warning LNK4099: PDB 'utils.pdb' was not found Pin
_Flaviu26-Aug-19 23:51
member_Flaviu26-Aug-19 23:51 

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.