title: get OpenFileDialog button pressed
body: <p>I'm using an OpenFileDialog to let the user chose a file to open.
  it works, but if I chose a file and insted of pressing OK I press CANCEL it still opens the file because I picked up one.</p>
  
  <p>I found this code in the MSDN, but I can't see ::DialogResult::OK in my apllication</p>
  
  <pre><code>if ( openFileDialog1-&gt;ShowDialog() == ::DialogResult::OK )
    {
       if ( (myStream = openFileDialog1-&gt;OpenFile()) != nullptr )
       {
          // Insert code to read the stream here.
          myStream-&gt;Close();
       }
    }
  </code></pre>
  
  <p>my code is:</p>
  
  <pre><code>fileD1-&gt;ShowDialog();
  while(!fileD-&gt;FileName-&gt;Lenght!=0)
  {
  }
  and here I open the file
  </code></pre>
  
  <p>any other idea of how to know which button I pressed?
  I'm using c++ and visual studio 2008</p>