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

C / C++ / MFC

 
GeneralRe: Winsock Programming Pin
Steven M Hunt1-Dec-02 14:17
Steven M Hunt1-Dec-02 14:17 
GeneralExtracting attachments from email Pin
AlexMarbus30-Nov-02 13:42
AlexMarbus30-Nov-02 13:42 
GeneralRe: Extracting attachments from email Pin
Ravi Bhavnani30-Nov-02 14:42
professionalRavi Bhavnani30-Nov-02 14:42 
GeneralRe: Extracting attachments from email Pin
AlexMarbus30-Nov-02 14:48
AlexMarbus30-Nov-02 14:48 
GeneralRe: Extracting attachments from email Pin
Rohit  Sinha30-Nov-02 18:45
Rohit  Sinha30-Nov-02 18:45 
GeneralRe: Extracting attachments from email Pin
AlexMarbus6-Dec-02 12:48
AlexMarbus6-Dec-02 12:48 
GeneralMFC program crashes under Win XP Pin
Romik30-Nov-02 12:52
Romik30-Nov-02 12:52 
GeneralRe: MFC program crashes under Win XP Pin
Gary R. Wheeler1-Dec-02 6:27
Gary R. Wheeler1-Dec-02 6:27 
GeneralRe: MFC program crashes under Win XP Pin
Romik1-Dec-02 7:00
Romik1-Dec-02 7:00 
GeneralPrinting JPEG in Visual C++ Pin
gaumi30-Nov-02 12:21
gaumi30-Nov-02 12:21 
GeneralRe: Printing JPEG in Visual C++ Pin
Christian Graus30-Nov-02 12:47
protectorChristian Graus30-Nov-02 12:47 
General.txt-File Pin
Lucky200230-Nov-02 11:56
Lucky200230-Nov-02 11:56 
GeneralRe: .txt-File Pin
PJ Arends30-Nov-02 12:11
professionalPJ Arends30-Nov-02 12:11 
GeneralRe: .txt-File Pin
Lucky200230-Nov-02 12:23
Lucky200230-Nov-02 12:23 
GeneralRe: .txt-File Pin
PJ Arends30-Nov-02 14:46
professionalPJ Arends30-Nov-02 14:46 
GeneralRe: .txt-File Pin
Lucky20021-Dec-02 12:11
Lucky20021-Dec-02 12:11 
GeneralRe: .txt-File Pin
Christian Graus30-Nov-02 12:44
protectorChristian Graus30-Nov-02 12:44 
If you want to use standard C++, the easiest way is this:

#include<iostream>
#include<fstream>


std::ofstream out("c:\myfile.txt");
out << myCString.GetBuffer();
myCString.ReleaseBuffer(0);

Something like that. An iostream inserter for CString is easy to write, I believe I did one in my inserters article. After that, you could just do out << myCString; Actually, that might work anyhow, but I suspect not.

Of course, iostreams adds about 40k to your final .exe, so if you don't care about using standard C++, you can use the MFC classes, which I'm afraid I am not very familiar with.


Christian

No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002

Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002

Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
GeneralRe: .txt-File Pin
Lucky200230-Nov-02 13:02
Lucky200230-Nov-02 13:02 
GeneralRe: .txt-File Pin
Christian Graus30-Nov-02 13:08
protectorChristian Graus30-Nov-02 13:08 
GeneralRe: .txt-File Pin
Lucky200230-Nov-02 13:18
Lucky200230-Nov-02 13:18 
GeneralRe: .txt-File Pin
Nick Parker30-Nov-02 18:28
protectorNick Parker30-Nov-02 18:28 
GeneralRe: .txt-File Pin
Christian Graus30-Nov-02 21:50
protectorChristian Graus30-Nov-02 21:50 
GeneralRe: .txt-File Pin
Nick Parker1-Dec-02 1:38
protectorNick Parker1-Dec-02 1:38 
GeneralRe: .txt-File Pin
Christian Graus1-Dec-02 2:33
protectorChristian Graus1-Dec-02 2:33 
GeneralRe: .txt-File Pin
Lucky20021-Dec-02 12:13
Lucky20021-Dec-02 12:13 

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.