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

📄 caextinfodlg.cpp

📁 运行debug下的cisoca.exe即可。 由于在vc6.0下开发的
💻 CPP
字号:
// CAExtInfoDlg.cpp : implementation file
//

#include "stdafx.h"
#include "CisoCA.h"
#include "CAExtInfoDlg.h"
#include "CAInitSheet.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCAExtInfoDlg dialog
IMPLEMENT_DYNCREATE(CCAExtInfoDlg, CPropertyPage)

CCAExtInfoDlg::CCAExtInfoDlg(CWnd* pParent /*=NULL*/)
: CPropertyPage(CCAExtInfoDlg::IDD)
{
	//{{AFX_DATA_INIT(CCAExtInfoDlg)
	m_CAPwd			= _T("");
	m_CAPwdVerify	= _T("");
	m_len			= _T("");
	m_valid = _T("");
	m_certFileName = _T("");
	m_pvkFileName = _T("");
	//}}AFX_DATA_INIT
	pSheet = (CCAInitSheet*)pParent;
	
}


void CCAExtInfoDlg::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCAExtInfoDlg)
	DDX_Control(pDX, IDC_CA_KEYLEN, m_KeyLen);
	DDX_Text(pDX, IDC_CA_PWD, m_CAPwd);
	DDX_Text(pDX, IDC_CA_PWD_VERIFY, m_CAPwdVerify);
	DDX_Text(pDX, IDC_CA_VALID, m_valid);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CCAExtInfoDlg, CPropertyPage)
	//{{AFX_MSG_MAP(CCAExtInfoDlg)
	ON_WM_SHOWWINDOW()
	ON_CBN_EDITCHANGE(IDC_CA_KEYLEN, OnEditchangeCaKeylen)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCAExtInfoDlg message handlers

BOOL CCAExtInfoDlg::OnApply() 
{
	// TODO: Add your specialized code here and/or call the base class
	
	return CPropertyPage::OnApply();
}

void CCAExtInfoDlg::OnOK() 
{
	// TODO: Add your specialized code here and/or call the base class
	CPropertyPage::OnOK();
}

LRESULT CCAExtInfoDlg::OnWizardBack() 
{
	// TODO: Add your specialized code here and/or call the base class
	
	return CPropertyPage::OnWizardBack();
}

LRESULT CCAExtInfoDlg::OnWizardNext() 
{
	// TODO: Add your specialized code here and/or call the base class
	return CPropertyPage::OnWizardNext();
}

BOOL CCAExtInfoDlg::OnWizardFinish() 
{
	// TODO: Add your specialized code here and/or call the base class
	(GetDlgItem(IDC_CA_PWD))->GetWindowText(m_CAPwd);
	(GetDlgItem(IDC_CA_PWD_VERIFY))->GetWindowText(m_CAPwdVerify);
	(GetDlgItem(IDC_CA_VALID))->GetWindowText(m_valid);
	int idx = 0;
	if(m_valid.IsEmpty())
	{
		AfxMessageBox("有效期不能为空!\n\n有效期以天为单位!");
		goto err;
	}
	if( m_CAPwd.Compare(m_CAPwdVerify) != 0 )
	{
		
		::MessageBox(NULL,"密码不匹配,请重新输入!","系统提示",
			MB_OK|MB_ICONEXCLAMATION);
		(GetDlgItem(IDC_CA_PWD))->SetWindowText(_T(""));
		(GetDlgItem(IDC_CA_PWD_VERIFY))->SetWindowText(_T(""));
		// 张荣华
		// 2004/03/24修改了密码不匹配也会出现"证书制作成功"提示的bug
		//
		goto err;
		
	}
	m_KeyLen.GetLBText(idx,m_len);
	return TRUE;
err:
	((CCAInitSheet*)pSheet)->SetActivePage(this);
	return FALSE;
}

BOOL CCAExtInfoDlg::OnSetActive() 
{
	// TODO: Add your specialized code here and/or call the base class
	((CCAInitSheet*)pSheet)->SetWizardButtons(PSWIZB_BACK|PSWIZB_FINISH);
	return CPropertyPage::OnSetActive();
}

BOOL CCAExtInfoDlg::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
	
	// TODO: Add extra initialization here		
	m_KeyLen.AddString("512");
	m_KeyLen.AddString("768");
	m_KeyLen.AddString("1024");
	m_KeyLen.AddString("2048");
	m_KeyLen.SetCurSel(2);
	//组合框的第一个子窗口就是编辑控件
	CEdit* pe=(CEdit*)(GetDlgItem(IDC_CA_KEYLEN)->GetWindow(GW_CHILD));
	pe->EnableWindow(TRUE);   
	//使编辑窗口生效,并且设置为只读
	pe->SetReadOnly();
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CCAExtInfoDlg::OnShowWindow(BOOL bShow, UINT nStatus) 
{
	CPropertyPage::OnShowWindow(bShow, nStatus);
	
	// TODO: Add your message handler code here
	(GetDlgItem(IDC_CA_VALID))->SetWindowText(_T("365"));
}

void CCAExtInfoDlg::OnEditchangeCaKeylen() 
{
	// TODO: Add your control notification handler code here
	m_KeyLen.Clear();
	m_KeyLen.AddString("512");
	m_KeyLen.AddString("768");
	m_KeyLen.AddString("1024");
	m_KeyLen.AddString("2048");
	m_KeyLen.SetCurSel(2);
}

⌨️ 快捷键说明

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