Skip to main content
www.olaf-groeger.de

Main navigation

  • Home
  • NMR
  • Programming
    • Streams
    • Subclassing of edit controls
  • Software
    • Calimah Scheduler
    • ServicesCtl

Breadcrumb

  1. Home
  2. Programming
  3. Streams
  4. Console Window For GUI-based Windows Applications
  5. Derive a New Outer Class Which Uses The Inner Class

Derive a new outer class which uses the inner class

By olaf , 30 June 2025

Well, the job is nearly done. The class OG_constream doesn't extend its base class with new functionality. It only creates the buffer in the constructor and deletes the buffer in the destructor.
OG_constream::OG_constream() : ostream(new OG_constreambuf())
{
}

OG_constream::OG_constream(int i) : ostream(new OG_constreambuf(i))
{
}

OG_constream::~OG_constream()
{
  OG_constreambuf* pOG_constreambuf = (OG_constreambuf*) rdbuf();
  if (pOG_constreambuf)
    delete pOG_constreambuf;
}

Book traversal links for 3

  • Overriding the methods of the base class streambuf that are called when output should be written
  • Up
  • Usage and Download

Language switcher

  • English
  • German
Powered by Drupal