add this anywhere in your code:
BOOL result;
OPENFILENAME ofn;
TCHAR fu[_MAX_PATH];
memset(fu, 0, sizeof(fu));
// Initialize OPENFILENAME
ZeroMemory(&ofn, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);//OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = NULL;
ofn.lpstrFile = fu;
ofn.nMaxFile = sizeof(fu)-5;
ofn.lpstrFilter = "Whatever\0*.*\0";
ofn.nFilterIndex = 1;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
// Display the Open dialog box.
result=GetOpenFileName(&ofn);
And you'll get a memory overflow or heap or something like that error once the program reaches the "return;" of the main function.