⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 settingdialog.cpp

📁 基于dialogic语音卡的IVR系统源代码
💻 CPP
字号:
// SettingDialog.cpp : implementation file
//

#include "stdafx.h"
#include "Pansrmtc.h"
#include "SettingDialog.h"
#include "Answer.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSettingDialog dialog

CSettingDialog::CSettingDialog(CWnd* pParent /*=NULL*/)
	: CDialog(CSettingDialog::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSettingDialog)
	pApp = AfxGetApp();
	m_Faxpath = pApp->GetProfileString("PATH", "FAXPATH","\\Pansr\\FAX\\");
	m_Syspath = pApp->GetProfileString("PATH", "SYSPATH","\\Pansr\\VOC\\");
	m_Usrpath = pApp->GetProfileString("PATH", "USRPATH","\\Pansr\\VOC\\");
	m_Vscript = pApp->GetProfileString("IVRS", "VSCRIPT","\\Pansr\\VOC\\Vscript.txt");
	m_faxbdnum = pApp->GetProfileInt("VFAX", "FAXBDNUM",1);
	m_faxchans = pApp->GetProfileInt("VFAX", "FAXCHANS",4);
	m_maxchans = pApp->GetProfileInt("VOC", "MAXCHANS",4);
	m_msibdnum = pApp->GetProfileInt("MSI", "MSIBDNUM",0);
	m_msichans = pApp->GetProfileInt("MSI", "MSICHANS",0);
	m_d4xbdnum = pApp->GetProfileInt("VOC", "D4XBDNUM",1);
	//}}AFX_DATA_INIT
}

void CSettingDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSettingDialog)
	DDX_Text(pDX, IDC_FAX_PATH, m_Faxpath);
	DDV_MaxChars(pDX, m_Faxpath, 128);
	DDX_Text(pDX, IDC_SYS_PATH, m_Syspath);
	DDV_MaxChars(pDX, m_Syspath, 128);
	DDX_Text(pDX, IDC_USR_PATH, m_Usrpath);
	DDV_MaxChars(pDX, m_Usrpath, 128);
	DDX_Text(pDX, IDC_FAXBDNUM_EDIT, m_faxbdnum);
	DDV_MinMaxInt(pDX, m_faxbdnum, 0, 256);
	DDX_Text(pDX, IDC_FAXCHANS_EDIT, m_faxchans);
	DDV_MinMaxInt(pDX, m_faxchans, 0, 32);
	DDX_Text(pDX, IDC_MAXCHANS_EDIT, m_maxchans);
	DDV_MinMaxInt(pDX, m_maxchans, 1, 120);
	DDX_Text(pDX, IDC_MSIBDNUM_EDIT, m_msibdnum);
	DDV_MinMaxInt(pDX, m_msibdnum, 0, 256);
	DDX_Text(pDX, IDC_MSICHANS_EDIT, m_msichans);
	DDV_MinMaxInt(pDX, m_msichans, 0, 128);
	DDX_Text(pDX, IDC_D4XBDNUM_EDIT, m_d4xbdnum);
	DDV_MinMaxInt(pDX, m_d4xbdnum, 1, 256);
	DDX_Text(pDX, IDC_SYS_IVRS, m_Vscript);
	DDV_MaxChars(pDX, m_Vscript, 128);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSettingDialog, CDialog)
	//{{AFX_MSG_MAP(CSettingDialog)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSettingDialog message handlers

void CSettingDialog::OnOK() 
{
	// TODO: Add extra validation here
	//::Beep(500,100);
	//MessageBox("系统配置已被修改,请重新启动",NULL,MB_OK);

	CWinApp* pApp = AfxGetApp();
	UpdateData(TRUE);
	pApp->WriteProfileInt("VOC","MAXCHANS", m_maxchans);
	pApp->WriteProfileInt("VOC","D4XBDNUM", m_d4xbdnum);
	pApp->WriteProfileInt("FAX","FAXCHANS", m_faxchans);
	pApp->WriteProfileInt("FAX","FAXBDNUM", m_faxbdnum);
	pApp->WriteProfileInt("MSI","MSICHANS", m_msichans);
	pApp->WriteProfileInt("MSI","MSIBDNUM", m_msibdnum);

	pApp->WriteProfileString("PATH","SYSPATH", m_Syspath);
	pApp->WriteProfileString("PATH","USRPATH", m_Usrpath);
	pApp->WriteProfileString("PATH","FAXPATH", m_Faxpath);
	pApp->WriteProfileString("IVRS","VSCRIPT", m_Vscript);

	strcpy( SVocDir, m_Syspath );
	strcpy( GVocDir, m_Usrpath );
	strcpy( SFaxDir, m_Faxpath );
	strcpy( VScript, m_Vscript );

	maxchans = m_maxchans;
	faxchans = m_faxchans; 
	msichans = m_msichans; 
	d4xbdnum = m_d4xbdnum;
	faxbdnum = m_faxbdnum;
	msibdnum = m_msibdnum;

	CDialog::OnOK();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -