no instance of overloaded function "CFile::Open" matches the argument list
argument types are: (const char[15], CFile::OpenFlags)
VS2013 預設啟用 Unicode 字符集(UNICODE、_UNICODE 宏定義),CFile::Open 參數類型為 LPCTSTR(即 const wchar_t*),無法隱式接受 const char* 字面量。
// 錯誤
if (!File.Open("e:\\8bitcol.bmp", CFile::modeRead)) return;
// 正確:使用 _T() 或 TEXT() 宏自動適配字符集
if (!File.Open(_T("e:\\8bitcol.bmp"), CFile::modeRead)) return;
// 或顯式寬字符
if (!File.Open(L"e:\\8bitcol.bmp", CFile::modeRead)) return;
_T("...") 包裹,確保 Debug/Release、Unicode/MBCS 兼容。char* 與 TCHAR*,統一使用 CString 或 std::wstring。同理適用於所有 MFC/Win32 API 接受 LPCTSTR 的函數:CreateFile、MessageBox、SetWindowText 等。