Click here to Skip to main content
15,896,348 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: execute my c++ application en MFC SDI in batch mode with parameters Pin
MrKBA14-Jun-09 23:46
MrKBA14-Jun-09 23:46 
AnswerRe: execute my c++ application en MFC SDI in batch mode with parameters Pin
Stuart Dootson14-Jun-09 23:55
professionalStuart Dootson14-Jun-09 23:55 
GeneralRe: execute my c++ application en MFC SDI in batch mode with parameters Pin
MrKBA15-Jun-09 0:54
MrKBA15-Jun-09 0:54 
GeneralRe: execute my c++ application en MFC SDI in batch mode with parameters Pin
Stuart Dootson15-Jun-09 0:56
professionalStuart Dootson15-Jun-09 0:56 
GeneralRe: execute my c++ application en MFC SDI in batch mode with parameters Pin
MrKBA15-Jun-09 1:12
MrKBA15-Jun-09 1:12 
GeneralRe: execute my c++ application en MFC SDI in batch mode with parameters Pin
MrKBA15-Jun-09 1:20
MrKBA15-Jun-09 1:20 
GeneralRe: execute my c++ application en MFC SDI in batch mode with parameters Pin
David Crow15-Jun-09 2:47
David Crow15-Jun-09 2:47 
GeneralRe: execute my c++ application en MFC SDI in batch mode with parameters Pin
MrKBA15-Jun-09 21:48
MrKBA15-Jun-09 21:48 
QuestionGetattributename and value of an Xml Node... Pin
siva45514-Jun-09 21:32
siva45514-Jun-09 21:32 
AnswerRe: Getattributename and value of an Xml Node... Pin
Cedric Moonen14-Jun-09 21:36
Cedric Moonen14-Jun-09 21:36 
GeneralRe: Getattributename and value of an Xml Node... Pin
siva45514-Jun-09 21:39
siva45514-Jun-09 21:39 
GeneralRe: Getattributename and value of an Xml Node... Pin
«_Superman_»14-Jun-09 22:25
professional«_Superman_»14-Jun-09 22:25 
GeneralRe: Getattributename and value of an Xml Node... Pin
siva45514-Jun-09 22:32
siva45514-Jun-09 22:32 
GeneralRe: Getattributename and value of an Xml Node... Pin
«_Superman_»14-Jun-09 22:41
professional«_Superman_»14-Jun-09 22:41 
GeneralRe: Getattributename and value of an Xml Node... Pin
Stuart Dootson14-Jun-09 23:22
professionalStuart Dootson14-Jun-09 23:22 
QuestionMerge Xml [modified] Pin
p_196014-Jun-09 20:40
p_196014-Jun-09 20:40 
AnswerRe: Merge Xml Pin
Stuart Dootson14-Jun-09 23:29
professionalStuart Dootson14-Jun-09 23:29 
QuestionMultiple Inheritance doubt Pin
chirag_chauhan14-Jun-09 20:26
chirag_chauhan14-Jun-09 20:26 
My code snippet is something like this one,

class Base1
{
public:
Base1()
{
cout<<"Base1()"<<endl;
}
virtual void method()
{
cout<<"Base1::method()"<<endl;
}
};

class Base2
{
public:
Base2()
{
cout<<"Base2()"<<endl;
}
virtual void method()
{
cout<<"Base2::method()"<<endl;
}
};

class Derived:public Base1, public Base2
{
public:
Derived()
{
cout<<"Derived()"<<endl;
}
void method()
{
cout<<"Derived::method()"<<endl;
}
};

int _tmain(int argc, _TCHAR* argv[])
{
// Derived *d = static_cast<Derived *>(new Base1); // works fine

// application crash at Base2::method call, even though Base2() constructor is invoked
Derived *d = static_cast<Derived *>(new Base2);

d->method();
return 0;
}

With Base1, application works fine. But when I try to use Base2, application crashes at method() call.

And if I change the sequence in Derived class declaration to...

class Derived:public Base2, public Base1

then Base2 object works perfectly but Base1 crashes.

So, my question is why up-casting (or down-casting, not sure about specific word) works only with primary base class and not with secondary base classes??
AnswerRe: Multiple Inheritance doubt Pin
Mahesh Kulkarni14-Jun-09 20:55
Mahesh Kulkarni14-Jun-09 20:55 
AnswerRe: Multiple Inheritance doubt Pin
Cedric Moonen14-Jun-09 20:58
Cedric Moonen14-Jun-09 20:58 
GeneralRe: Multiple Inheritance doubt Pin
chirag_chauhan14-Jun-09 23:03
chirag_chauhan14-Jun-09 23:03 
Questiontext search Pin
ali kanju14-Jun-09 19:59
ali kanju14-Jun-09 19:59 
AnswerRe: text search Pin
Mahesh Kulkarni14-Jun-09 20:18
Mahesh Kulkarni14-Jun-09 20:18 
GeneralRe: text search Pin
ali kanju14-Jun-09 20:27
ali kanju14-Jun-09 20:27 
GeneralRe: text search Pin
Cedric Moonen14-Jun-09 21:08
Cedric Moonen14-Jun-09 21:08 

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.