Here is what I do:
string OpenFileDialog ( HWND hwnd, LPSTR filter )
{
string file;
char szFile[260];
OPENFILENAME ofn;
ZeroMemory ( &ofn, sizeof ( ofn ) );
ofn.lStructSize = sizeof ( ofn );
ofn.hwndOwner = hwnd;
ofn.lpstrFile = szFile;
ofn.lpstrFile[0] = '\0';
ofn.nMaxFile = sizeof ( szFile );
ofn.lpstrFilter = filter;
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
if ( GetOpenFileName ( &ofn ) )
file = ofn.lpstrFile;
// return file
return file;
}
This function shows the windows open file dialog and returns the file name as std::string.
Now the plot thickens, the fps decreases, and the awesomeness goes through the roof.