title: How to access to variable on parent class mfc
body: <p>I have a Dialog on MFC application. </p>
  
  <pre><code>MyDialog :
  {
   int variable1;
   int variable2;
   Class1 cls = new Class1();
  }
  </code></pre>
  
  <p>And in class1()</p>
  
  <pre><code> Class1() 
   {
       void Function1()
       void Function2()
   }
  </code></pre>
  
  <p>--</p>
  
  <p><strong>So How to Access and return to variable1 in Class1::Function1()</strong> </p>
  
  <pre><code>Class1::Function1()
  {
    MyDialog dlg = new MyDialog ();
    Get x = dlg-&gt;variable1; //if like this, variable1 alway=0, because in above line, i'm define new myDialog()
  }
  </code></pre>
  
  <p>I think to delegate on .NET but in MFC application, I can't get it done ?</p>