Click here to Skip to main content
15,892,697 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Start->Run Pin
Tim Smith19-Jan-02 3:58
Tim Smith19-Jan-02 3:58 
General[callback] atribute in ATL! Pin
Mazdak18-Jan-02 20:31
Mazdak18-Jan-02 20:31 
GeneralRe: [callback] atribute in ATL! Pin
Michael P Butler19-Jan-02 2:22
Michael P Butler19-Jan-02 2:22 
GeneralRe: [callback] atribute in ATL! Pin
Tim Smith19-Jan-02 3:56
Tim Smith19-Jan-02 3:56 
GeneralRe: [callback] atribute in ATL! Pin
Mazdak19-Jan-02 18:36
Mazdak19-Jan-02 18:36 
GeneralAutoCompletion Popup Listbox control Pin
18-Jan-02 17:12
suss18-Jan-02 17:12 
GeneralRe: AutoCompletion Popup Listbox control Pin
Philip Patrick19-Jan-02 0:05
professionalPhilip Patrick19-Jan-02 0:05 
GeneralRe: AutoCompletion Popup Listbox control Pin
19-Jan-02 7:54
suss19-Jan-02 7:54 
GeneralRe: AutoCompletion Popup Listbox control Pin
Diarrhio20-Jan-02 14:40
Diarrhio20-Jan-02 14:40 
GeneralRe: AutoCompletion Popup Listbox control Pin
gh20-Jan-02 17:42
gh20-Jan-02 17:42 
GeneralTypedef problems Pin
Stephen Caldwell18-Jan-02 16:20
Stephen Caldwell18-Jan-02 16:20 
GeneralRe: Typedef problems Pin
Michael Dunn18-Jan-02 16:36
sitebuilderMichael Dunn18-Jan-02 16:36 
GeneralRe: Typedef problems Pin
Stephen Caldwell18-Jan-02 16:44
Stephen Caldwell18-Jan-02 16:44 
GeneralRe: Typedef problems Pin
Michael Dunn18-Jan-02 16:43
sitebuilderMichael Dunn18-Jan-02 16:43 
GeneralRe: Typedef problems Pin
Nish Nishant18-Jan-02 16:54
sitebuilderNish Nishant18-Jan-02 16:54 
QuestionHow do I write my own stream? Pin
Xavier John18-Jan-02 16:10
Xavier John18-Jan-02 16:10 
How can I write my own stream?
I need to write a stream class and redirect cerr to it. Based on the class settings I will log it to a file or a database.

I need to use the class like below
#include <iostream>
#include <fstream>
int main()
{
std::ofstream logFile("out.txt");
std::streambuf *outbuf = std::cout.rdbuf(logFile.rdbuf());
std::streambuf *errbuf = std::cerr.rdbuf(logFile.rdbuf());

// do the actual work of the program;
// GUI code and event loop would go here
std::cout << "This would normally go to cout but goes to the log file\n";
std::cerr << "This would normally go to cerr but goes to the log file \n";
logFile << "This goes to the log file\n";
// end of program body

// restore the buffers
std::cout.rdbuf(outbuf);
std::cerr.rdbuf(errbuf);
}

But my class will log to the disk or log to a DBMS.

Regards,
Xavier

AnswerRe: How do I write my own stream? Pin
Christian Graus18-Jan-02 22:51
protectorChristian Graus18-Jan-02 22:51 
GeneralWould anyone give some ideas about DirectShow,thanks !! Pin
MrGao18-Jan-02 16:03
MrGao18-Jan-02 16:03 
GeneralEmbedding Word Automation in My App..But.. _Document.SaveAs... Pin
SoonWon18-Jan-02 15:15
SoonWon18-Jan-02 15:15 
GeneralActiveX scripting engine link error Pin
Neville Franks18-Jan-02 14:10
Neville Franks18-Jan-02 14:10 
GeneralAutomation problems using MFC Pin
Jean Louis18-Jan-02 11:37
Jean Louis18-Jan-02 11:37 
GeneralRe: Automation problems using MFC Pin
moredip18-Jan-02 12:13
moredip18-Jan-02 12:13 
GeneralRe: Automation problems using MFC Pin
Jean Louis18-Jan-02 12:19
Jean Louis18-Jan-02 12:19 
GeneralRe: Automation problems using MFC Pin
Jean Louis18-Jan-02 12:48
Jean Louis18-Jan-02 12:48 
GeneralRe: Automation problems using MFC Pin
moredip18-Jan-02 12:55
moredip18-Jan-02 12:55 

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.