Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming > Application Programming

Reply
 
LinkBack Thread Tools
Old 02-10-08   #1 (permalink)
HULK SMASH!!!
 
Kamakazi's Avatar
 
intel nvidia

Join Date: Jun 2006
Posts: 3,994
Blog Entries: 2

Folding Team Rank: 1894
Hardware Reviews: 1
Trader Rating: 11
Default C++ CString Convert to const char

Okay problem at the moment is as such:

Code:
CString exporttext("something");
CString exporttext2("somethingelse");
ofstream font("font.txt");
ofstream background("backcolor.txt");

font.write(exporttext, exporttext.GetLength());
background.write(exporttext2, exporttext2.GetLength());
When i do that I get this error

f:\visual studio 2005\projects\tstest3\tstest3\tstest3dlg.cpp(384) : error C2664: 'std::basic_ostream<_Elem,_Traits>::write' : cannot convert parameter 1 from 'CString' to 'const char *'


So how do I convert CString to const char *

I have seen lots of ways to get to LPCTSTR but that doesn't work either.
__________________
System: Galadriel
CPU
Q6600 SLACR
Motherboard
DFI LP UT
Memory
4GB G.Skill DDR2 1000
Graphics Card
eVGA 9800GTX+
Hard Drive
1x640 1x250 2x500 1x1TB
Sound Card
Onboard
Power Supply
610 PC P&C Silencer
Case
Antec p182
CPU cooling
Tuniq Tower
GPU cooling
Stock
OS
Vista Business 64bit
Monitor
2xBenQ 20"WS 1xRosewill 19"FS
Kamakazi is offline I fold for Overclock.net Overclocked Account   Reply With Quote
Old 02-10-08   #2 (permalink)
Windows Wrangler
 
mrtn400's Avatar
 
intel ati

Join Date: Aug 2007
Location: Carmichael, CA
Posts: 3,212
Blog Entries: 2

Rep: 208 mrtn400 is acknowledged by manymrtn400 is acknowledged by manymrtn400 is acknowledged by many
Unique Rep: 178
Hardware Reviews: 1
Trader Rating: 0
Default

Hmm, I'm not really big in any language but maybe:
Code:
    string whatyourcompilerwantstobeaconstant = "this is the string with information you're trying to export";
    const string thestringisnowconstant = whatyourcompilerwantstobeaconstant;
    fout<<thestringisnowconstant;
__________________
Je parle un peu le français, mais je préfère parler l'anglais. Parlez-vous le français aussi?

For you English speakers:

">" - greater than; "<" - less than
"there" - Hey, look over there.
"their" - I love their Mustang.
"they're" - They're so lucky!

System: Cataclysm (Main Rig)
CPU
Q6600 G0 1.325v @ 3296Mhz (412x8) 1.41v
Motherboard
Abit IP35 Pro
Memory
4x 1GB Patriot DDR2-800 @ 812Mhz 4-4-4-12 2.15v
Graphics Card
Sapphire 4850 @ 725Mhz/1050Mhz w/ Catalyst 8.7
Hard Drive
2x WD1600AAJS RAID0
Sound Card
Onboard 7.1
Power Supply
Antec True Power Trio 650w
Case
Antec 900
CPU cooling
Tuniq Tower 120 w/ Scythe SY1225SL12SH 120mm
GPU cooling
Thermalright T-RAD² w/ 2x Scythe DFS922512M-PWM
OS
Windows Vista Ultimate x64 SP1
Monitor
1x Acer 19" @ 1400x900, 1x Sceptre 19" @ 1280x1024
mrtn400 is offline mrtn400's Gallery   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -4. The time now is 03:50 AM.


Overclock.net is a Carbon Neutral Site Creative Commons License Internet Security By ControlScan

Terms of Service / Forum Rules | Privacy Policy | Advertising | Become an Official Vendor
Copyright © 2008 Shogun Interactive Development. Most rights reserved.
Page generated in 0.25736 seconds with 8 queries