Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: .txt-File Pin
Lucky20021-Dec-02 12:12
Lucky20021-Dec-02 12:12 
QuestionIs there a way to translate your C++ code to assembly code in VS? Pin
Redeemer-dk30-Nov-02 11:28
Redeemer-dk30-Nov-02 11:28 
AnswerRe: Is there a way to translate your C++ code to assembly code in VS? Pin
Christian Graus30-Nov-02 12:48
protectorChristian Graus30-Nov-02 12:48 
GeneralRe: Is there a way to translate your C++ code to assembly code in VS? Pin
Redeemer-dk30-Nov-02 14:43
Redeemer-dk30-Nov-02 14:43 
GeneralRe: Is there a way to translate your C++ code to assembly code in VS? Pin
Christian Graus30-Nov-02 15:36
protectorChristian Graus30-Nov-02 15:36 
AnswerRe: Is there a way to translate your C++ code to assembly code in VS? Pin
Anatari30-Nov-02 18:38
Anatari30-Nov-02 18:38 
GeneralGet statusbar text area as a CPoint Pin
RobJones30-Nov-02 8:02
RobJones30-Nov-02 8:02 
GeneralAsk about SetPixel, Lineto and Moveto Pin
ooosawaddee330-Nov-02 3:56
ooosawaddee330-Nov-02 3:56 
GeneralRe: Ask about SetPixel, Lineto and Moveto Pin
Ravi Bhavnani30-Nov-02 8:51
professionalRavi Bhavnani30-Nov-02 8:51 

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.