title: Making dialog boxes
body: <p>I just want to ask is there a simple way in C++ to make dialog boxes (openfiledialog, savefiledialog) to be written like this:</p>
  
  <pre><code>' VB6 Example    
  'Setting up the "open file" dialog box.
  openDiag.DialogTitle = "Select a file to open"
  openDiag.Filter = "Exe files | *.exe" 'Ensures only EXE files can be selected.
  openDiag.ShowOpen 'Opens up the dialog
  'Takes the filename that was selected in the dialog and stores it in your OpenPath var and
  'also displays it in the textbox
  openPath = openDiag.FileName
  txtfilepath.Text = openPath
  </code></pre>
  
  <p>I'm assuming that I would need to use Classes, but I don't really know how to write this kind of code.</p>
  
  <p>Any help will be much appreciated !</p>
  
  <p>@@@FINAL EDIT@@@</p>
  
  <p>It Seems that this code doesn't compile when pasted in WIN32 Project in VS 2010.</p>
  
  <p>Gives me these errors:</p>
  
  <pre><code>error C2065: 'ofn' : undeclared identifier  c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2065: 'ofn' : undeclared identifier  c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2065: 'ofn' : undeclared identifier  c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2065: 'ofn' : undeclared identifier  c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2065: 'ofn' : undeclared identifier  c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2065: 'ofn' : undeclared identifier  c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2065: 'ofn' : undeclared identifier  c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2065: 'ofn' : undeclared identifier  c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2065: 'ofn' : undeclared identifier  c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2065: 'ofn' : undeclared identifier  c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2065: 'ofn' : undeclared identifier  c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2065: 'ofn' : undeclared identifier  c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2065: 'OFN_EXPLORER' : undeclared identifier c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2065: 'OFN_FILEMUSTEXIST' : undeclared identifier    c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2065: 'OFN_HIDEREADONLY' : undeclared identifier c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2065: 'OPENFILENAME' : undeclared identifier c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2065: 'OPENFILENAME' : undeclared identifier c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2070: ''unknown-type'': illegal sizeof operand   c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2070: ''unknown-type'': illegal sizeof operand   c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2146: syntax error : missing ';' before identifier 'ofn' c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2228: left of '.Flags' must have class/struct/union  c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2228: left of '.hwndOwner' must have class/struct/union  c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2228: left of '.lpstrDefExt' must have class/struct/union    c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2228: left of '.lpstrFile' must have class/struct/union  c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2228: left of '.lpstrFilter' must have class/struct/union    c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2228: left of '.lpstrTitle' must have class/struct/union c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2228: left of '.lStructSize' must have class/struct/union    c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  error C2228: left of '.nMaxFile' must have class/struct/union   c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  IntelliSense: identifier "OFN_EXPLORER" is undefined    c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  IntelliSense: identifier "OFN_FILEMUSTEXIST" is undefined   c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  IntelliSense: identifier "OFN_HIDEREADONLY" is undefined    c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  IntelliSense: identifier "OPENFILENAME" is undefined    c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp 
  IntelliSense: identifier "OPENFILENAME" is undefined    c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  IntelliSense: too many arguments in function call   c:\documents and settings\User\my documents\visual studio 2010\projects\program\program\program.cpp
  </code></pre>
  
  <p>Any suggestions on how to fix this error?</p>
  
  <p>EDIT:</p>
  
  <p>Found it myself...</p>
  
  <p>Needed to include </p>
  
  <pre><code>#include &lt;Commdlg.h&gt;
  </code></pre>