|
5#
楼主 |
发表于 2009-1-14 11:20:09
|
只看该作者
void SetUpDlg::OnBnClickedButton11() //下载参数INI
{
char *pszFileData = new char[64*1024];
EnterCriticalSection( &m_txt);
if( HV_GetIniFile( m_HV, pszFileData, 1024*1024) == S_OK )
AfxMessageBox("下载INI成功!");
CString strTemp = pszFileData;
strTemp.Replace( "\n" ,"\r\n");
strcpy( pszFileData, (LPCSTR)(LPCTSTR)strTemp );
FILE* efile = fopen( ".\\参数\\INI.ini","wt");
fwrite( pszFileData,1,strlen(pszFileData), efile);
LeaveCriticalSection(&m_txt);
fclose(efile);
delete[] pszFileData;
}
void SetUpDlg::OnBnClickedButton13() //上传参数INI
{
char *pszFileData = new char[64*1024];
FILE* file = fopen( ".\\参数\\上传INI.ini" ,"rb");
DWORD32 dwFileSize = static_cast< DWORD32 >( fread( pszFileData, 1, 64*1024 , file) );
pszFileData[ dwFileSize ] = '\0';
if (HV_SetIniFile( m_HV, pszFileData ) == S_OK )
AfxMessageBox("上传INI成功!");
fclose( file );
delete[] pszFileData;
} |
|