You probably need something similar to this:
#include <Windows.h>
OPENFILENAME ofn;
char szFileName[MAX_PATH];
strcpy(szFileName, "Test.csv");
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = NULL;
ofn.lpstrFilter = (LPCSTR)"All Files (*.*)";
ofn.lpstrFile = (LPSTR)szFileName;
ofn.nMaxFile = MAX_PATH;
ofn.Flags = OFN_EXPLORER;
ofn.lpstrDefExt = (LPCSTR)"csv";
if (GetSaveFileName(&ofn))
{
std::string pathToFile = ofn.lpstrFile;
// save you file here, using pathToFile
}
else
{
puts("Something went wrong");
}
You open file explorer with default file name of "Test.csv". Then, you can select the directory and after pressing "Save" you get the global file path. This path could be later used to save you file.
Also, docs that you may consider useful:
GetSaveFileName
OPENFILENAME