GetPrivateProfileString

来源:互联网 发布:江汉大学教务网络 编辑:程序博客网 时间:2024/06/05 18:52
void CTelInfo::InitConfig()
{
LPTSTR lpPath = new char[MAX_PATH];
LPTSTR tmpChar = new char[512];
int iDebug;
CString strTmp;


strcpy(lpPath, ".\\Config.ini");


memset( tmpChar, 0x00, sizeof(tmpChar));
GetPrivateProfileString("SendFilePath", "RECORD", "", tmpChar, 512, lpPath);
m_strRec.Format( "%s", tmpChar );


memset( tmpChar, 0x00, sizeof(tmpChar));
GetPrivateProfileString("SendFilePath", "WAVFILE", "", tmpChar, 512, lpPath);
m_strFile.Format( "%s", tmpChar );


m_iDialSince = GetPrivateProfileInt("SendFilePath", "DIALSINCE", 100, lpPath);
if(m_iDialSince < 100 || m_iDialSince > 150)
{
m_iDialSince = 100;
}


iDebug = GetPrivateProfileInt("Debug", "DEBUGMODEL", 0, lpPath);


memset( tmpChar, 0x00, sizeof(tmpChar));
GetPrivateProfileString("RecordPath", "RECORDPATH_CLIENT", "D:\\电话录音", tmpChar, 512, lpPath);
strTmp.Format( "%s", tmpChar  );

m_strRecPath =  strTmp + m_strLoginUserName;
m_sRecordAddr = strTmp + m_strLoginUserName;
delete [] lpPath; 
delete [] tmpChar;

}
0 0