📄 filefactory.cpp
字号:
// FileFactory.cpp: implementation of the CFileFactory class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "FileFactory.h"
const char CFileFactory::SZ_FILE_FLAG[] = "scimmires_";
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CFileFactory::CFileFactory()
{
m_bModified = FALSE;
}
CFileFactory::~CFileFactory()
{
}
BOOL CFileFactory::FileIsWritable( LPCTSTR pszFileName )
{
_ASSERTE( pszFileName != NULL );
WIN32_FIND_DATA wfd;
HANDLE hFind = ::FindFirstFile(pszFileName, &wfd);
if( hFind != INVALID_HANDLE_VALUE )
{
DWORD dwFileAttr = wfd.dwFileAttributes;
::FindClose(hFind);
// 如果文件已经存在,判断是否是只读属性并提示用户。
if(dwFileAttr & FILE_ATTRIBUTE_READONLY)
{
_tcscpy(m_szErrMsg, _T("The file is read only! can't save!"));
return FALSE;
}
}
return TRUE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -