Es wird mit ASCII - Einstellung unter VS 2017 compiliert.
Hier GetOpenFileName:
Code: Alles auswählen
OPENFILENAME oOpenFileName;
char _szFile[ 65536 ] = "";
char _szDir[ 256 ];
ZeroMemory(&oOpenFileName, sizeof(oOpenFileName));
oOpenFileName.lStructSize = sizeof(oOpenFileName);
oOpenFileName.hwndOwner = pMainFrame->GetHWnd();
oOpenFileName.lpstrFile = _szFile;
oOpenFileName.nMaxFile = sizeof(_szFile);
oOpenFileName.nFilterIndex = 1;
oOpenFileName.lpstrFileTitle = NULL;
oOpenFileName.nMaxFileTitle = 0;
oOpenFileName.lpstrInitialDir = _szDir;
oOpenFileName.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_ENABLESIZING | OFN_EXPLORER | ( bMultiSelect ? OFN_ALLOWMULTISELECT : 0 );
strcpy_s( _szFile, &strPathFileName[ 0 ] );
strcpy_s( _szDir, &strPathFileName.GetPath()[0] );
if (m_strFilter.GetCount())
oOpenFileName.lpstrFilter=&m_strFilter[0];
else
oOpenFileName.lpstrFilter=_T("All Files (*.*)\0*.*\0");
if (!GetOpenFileName(&oOpenFileName))
return false;
Code: Alles auswählen
OPENFILENAME oOpenFileName;
char _szFile[65536]="";
ZeroMemory(&oOpenFileName, sizeof(oOpenFileName));
oOpenFileName.lStructSize = sizeof(oOpenFileName);
oOpenFileName.hwndOwner = pMainFrame->GetHWnd();
oOpenFileName.lpstrFile = _szFile;
oOpenFileName.nMaxFile = sizeof(_szFile);
oOpenFileName.nFilterIndex = 1;
oOpenFileName.lpstrFileTitle = NULL;
oOpenFileName.nMaxFileTitle = 0;
oOpenFileName.lpstrInitialDir = NULL;
oOpenFileName.Flags = OFN_PATHMUSTEXIST | OFN_ENABLESIZING;
strcpy_s(_szFile,&strPathFileName[0]);
if (m_strFilter.GetCount())
oOpenFileName.lpstrFilter=&m_strFilter[0];
else
oOpenFileName.lpstrFilter=_T("All Files (*.*)\0*.*\0");
if (!GetSaveFileName(&oOpenFileName))
return false;