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

C / C++ / MFC

 
QuestionHEAP: Heap block at 003BCB48 modified at 003BCC6C past requested size of 11c Pin
transoft12-Jul-09 8:27
transoft12-Jul-09 8:27 
AnswerRe: HEAP: Heap block at 003BCB48 modified at 003BCC6C past requested size of 11c Pin
Luc Pattyn12-Jul-09 8:36
sitebuilderLuc Pattyn12-Jul-09 8:36 
AnswerRe: HEAP: Heap block at 003BCB48 modified at 003BCC6C past requested size of 11c Pin
Stuart Dootson12-Jul-09 8:37
professionalStuart Dootson12-Jul-09 8:37 
AnswerRe: HEAP: Heap block at 003BCB48 modified at 003BCC6C past requested size of 11c Pin
Luc Pattyn12-Jul-09 9:58
sitebuilderLuc Pattyn12-Jul-09 9:58 
Questionvptr help? [modified] Pin
sam_psycho12-Jul-09 6:20
sam_psycho12-Jul-09 6:20 
AnswerRe: vptr help? Pin
Stuart Dootson12-Jul-09 8:08
professionalStuart Dootson12-Jul-09 8:08 
GeneralRe: vptr help? Pin
Graham Shanks12-Jul-09 8:36
Graham Shanks12-Jul-09 8:36 
GeneralRe: vptr help? Pin
Stuart Dootson12-Jul-09 8:46
professionalStuart Dootson12-Jul-09 8:46 
Better tell that to gcc, then - it gives this warning and error:

a.cpp:30: warning: direct base ‘base’ inaccessible in ‘d2’ due to ambiguity
a.cpp: In function ‘int main()’:
a.cpp:46: error: ‘base’ is an ambiguous base of ‘d2’


VC++ 2008 agrees

a.cpp(30) : error C2584: 'd2' : direct base 'base' is inaccessible; already a base of 'd1'
        a.cpp(5) : see declaration of 'base'
        a.cpp(16) : see declaration of 'd1'


The virtual qualifier needs to be applied to all inheritance instances of the shared base, so you need this code for it to compile (note virtual wherever 'base' is inherited):

 class base
{
public:
  void f1()
  {
    cout<<"base f1";
  }
 void f2()
  {
    cout<<"base f2";
  }
 };
class d1: virtual public base
{
 public:
 void f1()
  {
    cout<<"d1's f1";
  }

  void  f2()
  {
    cout<<"d1's f2";
  }
 };
 class d2: virtual public base, public d1
{
public:

    d2()
    {
      cout<<"d2 class construxtor\n";
    }
    ~d2()
    {
      cout<<" d2 class destructor\n";
    }

};

int main()
{
      base* obj= new d2;  
     obj->f1();
     obj->f2();
}


Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

GeneralRe: vptr help? Pin
Graham Shanks12-Jul-09 8:56
Graham Shanks12-Jul-09 8:56 
GeneralRe: vptr help? Pin
Stuart Dootson12-Jul-09 9:02
professionalStuart Dootson12-Jul-09 9:02 
GeneralRe: vptr help? Pin
Joe Woodbury12-Jul-09 17:25
professionalJoe Woodbury12-Jul-09 17:25 
GeneralRe: vptr help? Pin
Joe Woodbury12-Jul-09 17:30
professionalJoe Woodbury12-Jul-09 17:30 
GeneralRe: vptr help? Pin
sam_psycho12-Jul-09 8:42
sam_psycho12-Jul-09 8:42 
GeneralRe: vptr help? Pin
Stuart Dootson12-Jul-09 8:59
professionalStuart Dootson12-Jul-09 8:59 
GeneralRe: vptr help? Pin
«_Superman_»12-Jul-09 16:52
professional«_Superman_»12-Jul-09 16:52 
QuestionNow playing in vc++ Pin
storyera_storyera12-Jul-09 4:51
storyera_storyera12-Jul-09 4:51 
Questionhow to drag a document to a listctrl from desktop for example (mfc) Pin
johnfafa12-Jul-09 2:26
johnfafa12-Jul-09 2:26 
AnswerRe: how to drag a document to a listctrl from desktop for example (mfc) Pin
Stuart Dootson12-Jul-09 5:23
professionalStuart Dootson12-Jul-09 5:23 
GeneralRe: how to drag a document to a listctrl from desktop for example (mfc) Pin
johnfafa12-Jul-09 22:02
johnfafa12-Jul-09 22:02 
GeneralRe: how to drag a document to a listctrl from desktop for example (mfc) Pin
Stuart Dootson12-Jul-09 22:08
professionalStuart Dootson12-Jul-09 22:08 
GeneralRe: how to drag a document to a listctrl from desktop for example (mfc) Pin
Stuart Dootson12-Jul-09 23:38
professionalStuart Dootson12-Jul-09 23:38 
Questionthe parent of exe files in windows Pin
zon_cpp11-Jul-09 22:33
zon_cpp11-Jul-09 22:33 
AnswerRe: the parent of exe files in windows Pin
Stuart Dootson11-Jul-09 23:48
professionalStuart Dootson11-Jul-09 23:48 
GeneralRe: the parent of exe files in windows Pin
zon_cpp12-Jul-09 0:04
zon_cpp12-Jul-09 0:04 
GeneralRe: the parent of exe files in windows Pin
Stuart Dootson12-Jul-09 0:24
professionalStuart Dootson12-Jul-09 0:24 

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.