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

C / C++ / MFC

 
GeneralTable/Grid control Pin
Shay Harel13-Sep-02 10:44
Shay Harel13-Sep-02 10:44 
GeneralRe: Table/Grid control Pin
Pavel Klocek13-Sep-02 10:58
Pavel Klocek13-Sep-02 10:58 
GeneralRe: Table/Grid control Pin
Shay Harel16-Sep-02 3:18
Shay Harel16-Sep-02 3:18 
GeneralSaveing a project Pin
Steve Daly13-Sep-02 10:09
Steve Daly13-Sep-02 10:09 
GeneralRe: Saveing a project Pin
Pavel Klocek13-Sep-02 10:17
Pavel Klocek13-Sep-02 10:17 
GeneralRe: Saveing a project Pin
Ryan B.13-Sep-02 10:18
Ryan B.13-Sep-02 10:18 
GeneralFloating Document Interface (FDI) Pin
Ryan B.13-Sep-02 10:00
Ryan B.13-Sep-02 10:00 
GeneralVirtual Base Class & Constructor :: C++ Pin
valikac13-Sep-02 9:46
valikac13-Sep-02 9:46 
Hi.

I would like to know the best way to initialize a constructor in a virtual base base. For example,

[code]

// Base class
class Base()
{
public:
A(int i = 0);
virtual void printA() const = 0;
};

// Derived classes
class X() : public virtual Base
{
public:
X(char a, int j);
virtual void printA();
};

X::X(char a, int j)
{
char temp = a;
A::A(j);
}

class Y() : public virtual Base
{
public:
Y(long x, int k);
virtual void printA();
};

Y::Y(long x, int k)
{
long temp = x;
A::A(k);
}

// Next level down in hierarchy

class Z(); public X, public Y
{
public:
Z(...?...); // What data do I need here to construct X, Y, and Base?
...
};

Z::Z(...?...)
{
// Do you contruct class X, Y, or Base first?
}

// Implementation

Z example(...?...); // You need to construct Base first.
[/code]

I know the question is very basic to polymorphic C++ programming. Nonetheless, it is something that want really want to understand.

Thanks,
Kuphryn
GeneralRe: Virtual Base Class & Constructor :: C++ Pin
Joaquín M López Muñoz13-Sep-02 9:57
Joaquín M López Muñoz13-Sep-02 9:57 
GeneralRe: Virtual Base Class & Constructor :: C++ Pin
valikac13-Sep-02 10:03
valikac13-Sep-02 10:03 
GeneralRe: Virtual Base Class & Constructor :: C++ Pin
Mike Nordell14-Sep-02 3:43
Mike Nordell14-Sep-02 3:43 
GeneralRe: Virtual Base Class & Constructor :: C++ Pin
valikac14-Sep-02 7:11
valikac14-Sep-02 7:11 
Generalprogrammatically creating new doc Pin
brianwelsch13-Sep-02 9:22
brianwelsch13-Sep-02 9:22 
GeneralRe: programmatically creating new doc Pin
Pavel Klocek13-Sep-02 9:56
Pavel Klocek13-Sep-02 9:56 
GeneralRe: programmatically creating new doc Pin
brianwelsch13-Sep-02 10:31
brianwelsch13-Sep-02 10:31 
GeneralRe: programmatically creating new doc Pin
Pavel Klocek13-Sep-02 10:52
Pavel Klocek13-Sep-02 10:52 
GeneralRe: programmatically creating new doc Pin
brianwelsch13-Sep-02 11:00
brianwelsch13-Sep-02 11:00 
GeneralRe: programmatically creating new doc Pin
Pavel Klocek13-Sep-02 11:22
Pavel Klocek13-Sep-02 11:22 
GeneralRe: programmatically creating new doc Pin
brianwelsch13-Sep-02 11:25
brianwelsch13-Sep-02 11:25 
GeneralRe: programmatically creating new doc Pin
Pavel Klocek13-Sep-02 11:30
Pavel Klocek13-Sep-02 11:30 
Generalquick STL question: Pin
ns13-Sep-02 9:21
ns13-Sep-02 9:21 
GeneralRe: quick STL question: Pin
Joaquín M López Muñoz13-Sep-02 9:29
Joaquín M López Muñoz13-Sep-02 9:29 
GeneralRe: quick STL question: Pin
Chris Losinger13-Sep-02 9:29
professionalChris Losinger13-Sep-02 9:29 
GeneralRe: quick STL question: Pin
ns13-Sep-02 9:39
ns13-Sep-02 9:39 
QuestionTutorial on threads?? Pin
DarrollWalsh13-Sep-02 7:39
DarrollWalsh13-Sep-02 7:39 

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.