// SoftAuth.cpp : 实现文件 // #include "stdafx.h" #include "ACD.h" #include "SoftAuth.h" #include "afxdialogex.h" #include "SoftAuther.h" // SoftAuth 对话框 IMPLEMENT_DYNAMIC(SoftAuth, CDialogEx) SoftAuth::SoftAuth(CWnd* pParent /*=NULL*/) : CDialogEx(SoftAuth::IDD, pParent) { } SoftAuth::~SoftAuth() { } void SoftAuth::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); DDX_Control(pDX, IDC_EDIT1, m_show); DDX_Control(pDX, IDC_EDIT2, m_Enter); } BEGIN_MESSAGE_MAP(SoftAuth, CDialogEx) ON_BN_CLICKED(IDOK, &SoftAuth::OnBnClickedOk) ON_WM_CREATE() END_MESSAGE_MAP() // SoftAuth 消息处理程序 bool isReg=false; char Inputchar[50]={0}; void SoftAuth::OnBnClickedOk() { CString strInput; m_Enter.GetWindowTextA(strInput); memcpy(Inputchar,strInput.GetBuffer(0),strInput.GetLength()); SoftAuther tsd; isReg = tsd.ComareData(m_showdata,strInput.GetBuffer(0)); CDialogEx::OnOK(); } void SoftAuth::InitDlg(char* ch) { m_showdata=ch; } int SoftAuth::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CDialogEx::OnCreate(lpCreateStruct) == -1) return -1; return 0; } BOOL SoftAuth::OnInitDialog() { CDialogEx::OnInitDialog(); m_show.SetWindowText(m_showdata); return TRUE; // return TRUE unless you set the focus to a control // 异常: OCX 属性页应返回 FALSE }