Click here to Skip to main content
15,913,487 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow I can convert CString variable into char * ? Pin
Sameer_Thakur14-Dec-06 23:49
Sameer_Thakur14-Dec-06 23:49 
AnswerRe: How I can convert CString variable into char * ? Pin
prasad_som14-Dec-06 23:54
prasad_som14-Dec-06 23:54 
GeneralRe: How I can convert CString variable into char * ? Pin
toxcct15-Dec-06 1:55
toxcct15-Dec-06 1:55 
GeneralRe: How I can convert CString variable into char * ? Pin
prasad_som15-Dec-06 2:13
prasad_som15-Dec-06 2:13 
GeneralRe: How I can convert CString variable into char * ? Pin
David Crow15-Dec-06 3:51
David Crow15-Dec-06 3:51 
AnswerRe: How I can convert CString variable into char * ? Pin
prasad_som15-Dec-06 6:40
prasad_som15-Dec-06 6:40 
AnswerRe: How I can convert CString variable into char * ? Pin
CPallini14-Dec-06 23:57
mveCPallini14-Dec-06 23:57 
AnswerRe: How I can convert CString variable into char * ? Pin
kakan15-Dec-06 0:59
professionalkakan15-Dec-06 0:59 
In my (non-unicode) programs I do like this:

char * cp = (char *) (LPCTSTR) CString;

It's not completely safe, since cp is a non-const char *, and LPCTSTR is a const pointer.
But as long as the resulting pointer (cp in this case) is used for reading only, it's perfectly safe.


Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson

GeneralRe: How I can convert CString variable into char * ? Pin
toxcct15-Dec-06 2:03
toxcct15-Dec-06 2:03 
GeneralRe: How I can convert CString variable into char * ? Pin
kakan15-Dec-06 2:15
professionalkakan15-Dec-06 2:15 
GeneralRe: How I can convert CString variable into char * ? Pin
CPallini15-Dec-06 2:22
mveCPallini15-Dec-06 2:22 
GeneralRe: How I can convert CString variable into char * ? Pin
kakan15-Dec-06 2:25
professionalkakan15-Dec-06 2:25 
AnswerRe: How I can convert CString variable into char * ? Pin
Rage15-Dec-06 1:32
professionalRage15-Dec-06 1:32 
AnswerRe: How I can convert CString variable into char * ? Pin
Hamid_RT15-Dec-06 18:17
Hamid_RT15-Dec-06 18:17 
Questionproblem with list control. Pin
priyank_ldce14-Dec-06 23:37
priyank_ldce14-Dec-06 23:37 
AnswerRe: problem with list control. Pin
prasad_som14-Dec-06 23:44
prasad_som14-Dec-06 23:44 
GeneralRe: problem with list control. Pin
priyank_ldce15-Dec-06 0:02
priyank_ldce15-Dec-06 0:02 
QuestionVariable not shared between dlls... Pin
Shy Agam14-Dec-06 23:35
Shy Agam14-Dec-06 23:35 
AnswerRe: Variable not shared between dlls... Pin
pnkj15-Dec-06 2:06
pnkj15-Dec-06 2:06 
GeneralRe: Variable not shared between dlls... [modified] Pin
Shy Agam15-Dec-06 3:40
Shy Agam15-Dec-06 3:40 
AnswerRe: Variable not shared between dlls... Pin
Michael Dunn15-Dec-06 11:58
sitebuilderMichael Dunn15-Dec-06 11:58 
QuestionCDialog Pin
Bravoone_200614-Dec-06 23:26
Bravoone_200614-Dec-06 23:26 
AnswerRe: CDialog Pin
Rage15-Dec-06 1:37
professionalRage15-Dec-06 1:37 
AnswerRe: CDialog Pin
Hamid_RT15-Dec-06 2:38
Hamid_RT15-Dec-06 2:38 
QuestionRe: CDialog Pin
David Crow15-Dec-06 3:59
David Crow15-Dec-06 3:59 

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.