Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

CString to char *

Posted on 2004-09-23
2
189 Views
Last Modified: 2013-11-20
How can I do the above conversion? Thank you
0
Comment
Question by:iportu
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 50 total points
ID: 12137566
You can just use teh built-in conversion operator ("CString::operator LPCTSTR"), e.g.

CString strTest ("Some text here");
const char* psz = (LPCTSTR) strTest;

or

CString strTest ("Some text here");
char* psz = strTest.GetBuffer(0);
0
 

Author Comment

by:iportu
ID: 12137638
Thanks
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Separate files macro - Errors on larger data set 18 73
changeXy challenge 13 87
Can not remove SSL certificate on iPhone 6 - iOS10.2 12 833
Work with App store 7 67
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question