Thursday, 28 March 2013

0.5 CDialog issue

I noticed this when testing cmenuitem, when the following code is run it checks the address of the returning variable against the current pointer in the array. The thing is though that the return variable is a reference to a pointer object, I debugged massively the incoming and outgoing addresses in CDialog's add and I know for a fact that the proper address is stored within CDialog _fld but since curField() returns a reference I don't know how to get it to check against the proper address of the pointer it is referencing.

// Test7MenuItem.cpp

 for(int i=0;i<3;i++){
         if(&FD.curField() == m[i]){
            si[16] = '0' + i;
            FD[3].set(si);
          }

//cdialog.cpp

 CField& CDialog::curField(){
    return (CField&)_fld[_curidx];
  }

No comments:

Post a comment