Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

extending save_dlg

Help
2004-12-11
2013-04-15
  • moswald0000
    moswald0000
    2004-12-11

    How do you extend from save_dlg (or any other window class that has a non-default constructor)?

     
    • Steven Weiss
      Steven Weiss
      2004-12-14

      you just do this:

      struct some_wnd : wnd_extend<window_base, some_wnd>
      {
      some_wnd(int arg1);
      };

      -> your class
      struct derived_wnd : wnd_extend<some_wnd, derived_wnd>
      {
      derived_wnd() : wnd_extend<some_wnd, derived_wnd> (0)
      {}

      // or easier (though this doesn't work for multiple inheritance):
      derived_wnd() : extend_base(0)
      {}

      };

      wnd_extend passes the arguments to the c'tor of some_wnd. wnd_extend itself has a templated c'tor with up to 6 parameters (so that's the limit of some_wnd's c'tor!)