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

📄 sconfdlg.cpp

📁 可以实现一个简单的CA发放证书更新证书等等功能。
💻 CPP
字号:
// SConfDlg.cpp : implementation file
//

#include "stdafx.h"
#include "CisoCA.h"
#include "SConfDlg.h"
#include "MainFrm.h"
#include "CisoCADoc.h"

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

extern  CInfoReport InfoReport;
extern  DWORD dwMoudleID;

/////////////////////////////////////////////////////////////////////////////
// CSConfDlg dialog


CSConfDlg::CSConfDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CSConfDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSConfDlg)
	m_fSize = 0;
	//}}AFX_DATA_INIT

}


void CSConfDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSConfDlg)
	DDX_Control(pDX, IDCANCEL, m_cancel);
	DDX_Control(pDX, IDOK, m_ok);
	DDX_Text(pDX, IDC_FILESIZE, m_fSize);
	DDV_MinMaxInt(pDX, m_fSize, 1, 100);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSConfDlg, CDialog)
	//{{AFX_MSG_MAP(CSConfDlg)
	ON_WM_SHOWWINDOW()
	ON_EN_CHANGE(IDC_FILESIZE, OnChangeFilesize)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSConfDlg message handlers

CCisoCADoc * CSConfDlg::GetDocument()
{
	CMainFrame *pFrm =(CMainFrame*)((CCisoCAApp*)AfxGetApp())->m_pMainWnd;
	return (CCisoCADoc*)pFrm->GetActiveDocument();
}

void CSConfDlg::OnOK() 
{
	// TODO: Add extra validation here
	CCisoCADoc *pDoc = GetDocument();
	char buf[MAX_CONF_LINE]={0};
//	sprintf(buf,"%d",state);
//	pDoc->m_pConF->SetValue("ReInitCa",buf);
	CString str;
	((CEdit*)GetDlgItem(IDC_FILESIZE))->GetWindowText(str);
	sprintf(buf,"%s",(LPCTSTR)str);
	pDoc->m_pConF->SetValue("LogFileSize",buf);
	pDoc->m_pConF->SaveProperty(CONFIG_FILE);
	CDialog::OnOK();
}

void CSConfDlg::OnCancel() 
{
	// TODO: Add extra cleanup here
	
	CDialog::OnCancel();
}

void CSConfDlg::OnShowWindow(BOOL bShow, UINT nStatus) 
{
	CDialog::OnShowWindow(bShow, nStatus);
	
	// TODO: Add your message handler code here
	int res=0;
	CCisoCADoc *pDoc = GetDocument();
	char buf[MAX_CONF_LINE]={0};
	/*pDoc->m_pConF->GetValue("ReInitCa",buf);
	if(strlen(buf)>0)
	{
		res = atoi(buf);
	}
	if(res == 0) 
		m_reinit.SetCheck(0);
	else
		m_reinit.SetCheck(1);
	state =res;*/

	pDoc->m_pConF->GetValue("LogFileSize",buf);
	m_fSize = atoi(buf);
	UpdateData(FALSE);
}

void CSConfDlg::OnChangeFilesize() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function and call CRichEditCtrl().SetEventMask()
	// with the ENM_CHANGE flag ORed into the mask.
	
	// TODO: Add your control notification handler code here
	
}

BOOL CSConfDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	//设置按钮样式
	CString str = "确定";
	m_ok.SetIcon(IDI_BUTTON_OK);
	m_ok.SetTooltipText(&str);
	m_ok.SetBtnCursor(IDC_HAND);
	m_ok.SetActiveFgColor(RGB(255, 255, 255));

	str = "取消";
	m_cancel.SetIcon(IDI_BUTTON_CANCEL);
	m_cancel.SetTooltipText(&str);
	m_cancel.SetBtnCursor(IDC_HAND);
	m_cancel.SetActiveFgColor(RGB(255, 255, 255));

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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