1. open file and check:
a) not txt b) no diag info c) no write access
2. Picture_of_<name>, same location
1. char szFile[260]; // buffer for file name
ofn.lpstrFile = szFile;
cannot convert from 'char [260]' to 'LPWSTR'
分析:
TCHAR 是一个宏,可能会展开成 char 和 wchar_t
所以如果是UNICODE环境 用wstring
如果是MBCS 用string就可以
解决:
ifstream fin;
fin.open(docName); 可接受TCHAR *
Method 1:
Modify project setting -> not use Unicode
Method 2:
TCHAR path[MAX_PATH];
TCHAR a = str.GetAt(str.GetLength()-1);
if(a != _T( "\\ "))
m_dir += _T( "\\ ");
Method 2:
TCHAR path[MAX_PATH];
TCHAR a = str.GetAt(str.GetLength()-1);
if(a != _T( "\\ "))
m_dir += _T( "\\ ");