If
AfxMessageBox
which is defined as
int AfxMessageBox( LPCTSTR lpszText, UINT nType = MB_OK, UINT nIDHelp = 0 );
cannot take your
L"No FileName and path specified" LPCWSTR parameter
and fill in the remaining two with defaults it's almost certainly because you're building a Multibyte build or have otherwise failed to predfine
UNICODE
and
_UNICODE
in your build meaning that the preprocessor resolved definition of
AfxMessageBox
is in fact
int AfxMessageBox( const char* lpszText, unsigned int nType = MB_OK, unsigned int nIDHelp = 0 );
which no longer matches the use of
LPCWSTR
resulting from the
L"text"
macro.
You need to either build a UNICODE build or use
_T("No FileName and path specified")
which will work in both UNICODE and non UNICODE builds.