windows-nt/Source/XPSP1/NT/windows/feime/fe/infcat/mymfile.cpp

39 lines
596 B
C++
Raw Permalink Normal View History

2020-09-26 03:20:57 -05:00
#include "stdafx.h"
#include "mymfile.h"
CMyMemFile::CMyMemFile()
{
}
CMyMemFile::~CMyMemFile()
{
Close();
}
BOOL CMyMemFile::bOpen(LPCTSTR FileName)
{
BOOL bRet = FALSE;
const WORD UnicodePrefix=0xFEFF;
if (! Open(FileName,CFile::modeCreate | CFile::modeReadWrite)) {
fprintf(stderr,"Open target file failed ! %d\n",GetLastError());
goto Exit1;
}
Write(&UnicodePrefix,sizeof(WORD));
bRet = TRUE;
Exit1:
return bRet;
}
void CMyMemFile::bClose()
{
if (m_lpBuffer) {
CFile::Write(m_lpBuffer,m_nFileSize);
}
return;
}