Click here to Skip to main content
15,908,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CStrin passing error! Pin
Alexandru Savescu15-May-02 22:11
Alexandru Savescu15-May-02 22:11 
GeneralRe: CStrin passing error! Pin
Jonathan Craig16-May-02 10:32
Jonathan Craig16-May-02 10:32 
QuestionHow can I get Tabs to show inside my CMDIChildWnd's? Pin
rbc15-May-02 18:53
rbc15-May-02 18:53 
GeneralClient/Server app Pin
unknown soldier15-May-02 18:31
unknown soldier15-May-02 18:31 
GeneralRe: Client/Server app Pin
Michael P Butler15-May-02 22:20
Michael P Butler15-May-02 22:20 
GeneralRe: Client/Server app Pin
15-May-02 22:36
suss15-May-02 22:36 
GeneralRe: Client/Server app Pin
Jon Hulatt15-May-02 23:20
Jon Hulatt15-May-02 23:20 
Generaliostream problems Pin
Christian Graus15-May-02 18:20
protectorChristian Graus15-May-02 18:20 
I have created a new stream, which looks like this:

template <class charT, class traits>
class basic_osLogFile : public std::basic_streambuf<charT, traits>
{
...
}

What I want to do is create a class that encapsulates this, so I can easily go:

osLogFile f("c:\\Errors");
f << "error number " << nError << endl;
f.close();

I've tried this:

class osLogFile : public std::ostream
{
public:
osLogFile() : ostream(&msb),ios(0) {}
virtual ~osLogFile() { msb.pubsync(); }

private:
basic_osLogFile<char, std::char_traits<char> > msb;
};

but the errors are:

c:\my code\iostreams\testapp\debugstr\\debugstream.h(68) : error C2512: 'basic_ostream<char,struct std::char_traits<char> >' : no appropriate default constructor available
c:\my code\iostreams\testapp\debugstr\\debugstream.h(68) : error C2614: 'osLogFile' : illegal member initialization: 'ios' is not a base or member
c:\my code\iostreams\testapp\debugstr\\debugstream.h(68) : error C2614: 'osLogFile' : illegal member initialization: 'ostream' is not a base or member

Does anyone have any suggestions ?

Thanks.

Christian

The tragedy of cyberspace - that so much can travel so far, and yet mean so little.

<i>And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned.</i> - <b>Christopher Duncan - 18/04/2002</b>
GeneralRe: iostream problems Pin
Maxwell Chen15-May-02 18:59
Maxwell Chen15-May-02 18:59 
GeneralRe: iostream problems Pin
Christian Graus15-May-02 19:16
protectorChristian Graus15-May-02 19:16 
GeneralRe: iostream problems Pin
Maxwell Chen15-May-02 20:03
Maxwell Chen15-May-02 20:03 
GeneralRe: iostream problems Pin
Christian Graus15-May-02 20:32
protectorChristian Graus15-May-02 20:32 
GeneralRe: iostream problems Pin
Joaquín M López Muñoz15-May-02 20:47
Joaquín M López Muñoz15-May-02 20:47 
GeneralRe: iostream problems Pin
Christian Graus15-May-02 21:02
protectorChristian Graus15-May-02 21:02 
GeneralRe: iostream problems [edited] Pin
Joaquín M López Muñoz15-May-02 21:08
Joaquín M López Muñoz15-May-02 21:08 
GeneralRe: iostream problems Pin
Christian Graus15-May-02 21:11
protectorChristian Graus15-May-02 21:11 
GeneralRe: iostream problems Pin
Joaquín M López Muñoz15-May-02 21:17
Joaquín M López Muñoz15-May-02 21:17 
GeneralRe: iostream problems Pin
Joaquín M López Muñoz15-May-02 21:19
Joaquín M López Muñoz15-May-02 21:19 
GeneralRe: iostream problems Pin
Christian Graus15-May-02 22:49
protectorChristian Graus15-May-02 22:49 
GeneralC++ Components Question Pin
Nick Parker15-May-02 17:40
protectorNick Parker15-May-02 17:40 
GeneralRe: C++ Components Question Pin
Christian Graus15-May-02 18:17
protectorChristian Graus15-May-02 18:17 
GeneralRe: C++ Components Question Pin
Nick Parker15-May-02 18:46
protectorNick Parker15-May-02 18:46 
GeneralRe: C++ Components Question Pin
Nish Nishant15-May-02 18:55
sitebuilderNish Nishant15-May-02 18:55 
GeneralRe: C++ Components Question Pin
Nick Parker16-May-02 1:14
protectorNick Parker16-May-02 1:14 
GeneralRe: C++ Components Question Pin
Nish Nishant16-May-02 1:34
sitebuilderNish Nishant16-May-02 1:34 

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.