Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Cameras
scaleDown command
black out solved
Aircraft Tutorial
Mathematical XYZ ?
Its done This vs That
Its done first week
recommendations for screen video captures?
3DExplorer "Oddity "
New Director
ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Texturing
Big Break Contest Videos
New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Plasma?
Looking for Inspiration
Weird EMail Q
It 's done first week ?
Cherry not cranberry
New game
Camera Animation Problem
Particle plugins?
 
C++ question

C++ question

2004-06-11       - By Sebastien Dalphond

 Back
Reply:     <<     11     12     13     14  

You can simply cast the CString to a LPCTSTR
operator LPCTSTR ( ) const;

Then it can be used as a const char*, as in:

CString l_sFilename = "filename.txt";

const char* l_psFileName = (LPCTSTR)l_sFilename;

Sebastien Dalphond

__ ____ ____ _____
Sebastien Dalphond
R&D-Hybride

-- --Original Message-- --
From: owner-xsi@(protected) [mailto:owner-xsi@(protected)]On Behalf Of
Helge Mathee
Sent: Thursday, June 10, 2004 9:58 AM
To: XSI@(protected)
Subject: C++ question


 Maybe I am dumb.....

 how to convert a CString to a const char *?

 I need this to read files inside of a c++ operator...

 really weird... just doesn't work...

 thanks,

 helge

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859 (See http://iso-8859.ora-code.com)-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=299370715-10062004><FONT face=Arial color=#0000ff size=2>You
can simply cast the CString to a LPCTSTR</FONT>
<P><FONT face=Arial><FONT color=#0000ff><FONT size=2><B>operator</B>
<B>LPCTSTR</B> <B>(</B> <B>)</B> <B>const;</B></FONT></FONT></FONT></P>
<P><SPAN class=299370715-10062004><FONT face=Arial color=#0000ff size=2>Then it
can be used as a const char*, as in:</FONT></SPAN></P>
<P><SPAN class=299370715-10062004><FONT face=Arial color=#0000ff size=2>CString
l_sFilename = "filename.txt";</FONT></SPAN></P>
<P><SPAN class=299370715-10062004><FONT face=Arial color=#0000ff size=2>const
char* l_psFileName = (LPCTSTR)l_sFilename;</FONT></SPAN></P>
<P><SPAN class=299370715-10062004><FONT face=Arial color=#0000ff
size=2>Sebastien Dalphond</FONT></SPAN></P><SPAN class=299370715-10062004>
<P><FONT size=2>__ ____ ____ _____<BR>Sebastien Dalphond<BR>R&amp;D-Hybride
</FONT></P></SPAN></SPAN><FONT face=Tahoma size=2>-- --Original
Message-- --<BR><B>From:</B> owner-xsi@(protected)
[mailto:owner-xsi@(protected)]<B>On Behalf Of </B>Helge Mathee<BR><B>Sent:</B
>
Thursday, June 10, 2004 9:58 AM<BR><B>To:</B>
XSI@(protected)<BR><B>Subject:</B> C++ question<BR><BR></FONT></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid;
MARGIN-RIGHT: 0px">
 <DIV><FONT face=Arial size=2>Maybe I am dumb.....</FONT></DIV>
 <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
 <DIV><FONT face=Arial size=2>how to convert a CString to a const char
 *?</FONT></DIV>
 <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
 <DIV><FONT face=Arial size=2>I need this to read files inside of a c++
 operator...</FONT></DIV>
 <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
 <DIV><FONT face=Arial size=2>really weird... just doesn't work...</FONT></DIV>
 <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
 <DIV><FONT face=Arial size=2>thanks,</FONT></DIV>
 <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
 <DIV><FONT face=Arial size=2>helge</FONT></DIV></BLOCKQUOTE></BODY></HTML>