Code:
DPError dpResult = DPMS_SUCCESS;
FILE *hFile = NULL;
BOOL bRetValue = FALSE;
CDPString dpFilePath;
size_t size = 0;
char *tBuffer = new char[m_sFileSize];
tBuffer = m_pszStream;
dpFilePath = m_dpFilePath;
dpFilePath += "\\";
dpFilePath += m_dpFileName;
if(hFile == NULL)
{
hFile = fopen(dpFilePath, "a+");
if(hFile)
{
size = fwrite(m_pszStream, m_sFileSize,sizeof(char), hFile);
if(size < 0)
{
dpResult = DPMS_FILE_WRITE_ERROR;
}
fclose(hFile);
}
else
{
dpResult = DPMS_FILE_OPEN_ERROR;
}
}
return dpResult;
}
