title: Access function variables between friend classes
body: <p>Just wondering...how can I access the variable 'path' of ClassA function Open() from within another fucntion of class ClassB if both classes are declared 'friends'? I'm basically trying to populate a child window with info from the parent window when the child window is selected, although both windows have different classes. </p>
  
  <p>ClassA.cpp:</p>
  
  <pre><code>void ClassA::Open() 
  { 
  // Open Program Properties window 
  
  ClassB dlg; 
  
  dlg.DoModal(); 
  
  CString path; 
  
  path = m_DirTree.GetCurrentDir(); //Path specified by tree selection
  
  }
  </code></pre>
  
  <p>ClassB.cpp:</p>
  
  <pre><code>void ClassB::Display(){
  
  //HOW CAN I ACCESS 'path' HERE? 
  
  SetDlgItemText(IDC_PATH, path); //Populate the edit box 
  
  }
  </code></pre>
  
  <p>Thankyou for the replies...</p>