long attr = GetFileAttributes(pFilename);
if(attr != -1){ // ファイルがないと-1
if (FILE_ATTRIBUTE_READONLY == (attr & FILE_ATTRIBUTE_READONLY)) {
CString mess;
mess.Format("ファイルの書き込みに失敗しました。読み込み専用になっている可能性があります。->%s", pFilename);
AfxMessageBox(mess);
return false;
}
}