@@ -412,22 +412,19 @@ using namespace Yahel;
412
412
}
413
413
414
414
static bool DoPromptSingleTypeFileName (PWCHAR lpszFileNameBuffer,WORD bufferCapacity,LPCWSTR singleFilter,DWORD flags){
415
+ const CString fileName=Utils::DoPromptSingleTypeFileName (
416
+ lpszFileNameBuffer&&*lpszFileNameBuffer ? (LPCTSTR)Utils::ToStringT (lpszFileNameBuffer) : nullptr ,
417
+ singleFilter&&*singleFilter ? (LPCTSTR)Utils::ToStringT (singleFilter) : nullptr ,
418
+ flags
419
+ );
420
+ if (fileName.IsEmpty ())
421
+ return false ;
415
422
#ifdef UNICODE
416
- static_assert ( false , " " );
423
+ ::lstrcpyn ( lpszFileNameBuffer, fileName, bufferCapacity );
417
424
#else
418
- char singleFilterA[80 ], lpszFileNameBufferA[MAX_PATH];
419
- ::WideCharToMultiByte ( CP_ACP, 0 , singleFilter,-1 , singleFilterA,ARRAYSIZE(singleFilterA), nullptr,nullptr );
420
- ::WideCharToMultiByte ( CP_ACP, 0 , lpszFileNameBuffer,-1 , lpszFileNameBufferA,ARRAYSIZE(lpszFileNameBufferA), nullptr,nullptr );
421
- const CString fileName=Utils::DoPromptSingleTypeFileName (
422
- lpszFileNameBuffer&&*lpszFileNameBuffer ? lpszFileNameBufferA : nullptr ,
423
- singleFilter&&*singleFilter ? singleFilterA : nullptr ,
424
- flags
425
- );
426
- if (fileName.IsEmpty ())
427
- return false ;
428
425
::MultiByteToWideChar ( CP_ACP,0 , fileName,-1 , lpszFileNameBuffer,bufferCapacity );
429
- return true ;
430
426
#endif
427
+ return true ;
431
428
}
432
429
433
430
bool CHexaEditor::ShowOpenFileDialog (LPCWSTR singleFilter,DWORD ofnFlags,PWCHAR lpszFileNameBuffer,WORD bufferCapacity) const {
0 commit comments