中航光电的中间件仓库

SoftAuth.cpp 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // SoftAuth.cpp : 实现文件
  2. //
  3. #include "stdafx.h"
  4. #include "ACD.h"
  5. #include "SoftAuth.h"
  6. #include "afxdialogex.h"
  7. #include "SoftAuther.h"
  8. // SoftAuth 对话框
  9. IMPLEMENT_DYNAMIC(SoftAuth, CDialogEx)
  10. SoftAuth::SoftAuth(CWnd* pParent /*=NULL*/)
  11. : CDialogEx(SoftAuth::IDD, pParent)
  12. {
  13. }
  14. SoftAuth::~SoftAuth()
  15. {
  16. }
  17. void SoftAuth::DoDataExchange(CDataExchange* pDX)
  18. {
  19. CDialogEx::DoDataExchange(pDX);
  20. DDX_Control(pDX, IDC_EDIT1, m_show);
  21. DDX_Control(pDX, IDC_EDIT2, m_Enter);
  22. }
  23. BEGIN_MESSAGE_MAP(SoftAuth, CDialogEx)
  24. ON_BN_CLICKED(IDOK, &SoftAuth::OnBnClickedOk)
  25. ON_WM_CREATE()
  26. END_MESSAGE_MAP()
  27. // SoftAuth 消息处理程序
  28. bool isReg=false;
  29. char Inputchar[50]={0};
  30. void SoftAuth::OnBnClickedOk()
  31. {
  32. CString strInput;
  33. m_Enter.GetWindowTextA(strInput);
  34. memcpy(Inputchar,strInput.GetBuffer(0),strInput.GetLength());
  35. SoftAuther tsd;
  36. isReg = tsd.ComareData(m_showdata,strInput.GetBuffer(0));
  37. CDialogEx::OnOK();
  38. }
  39. void SoftAuth::InitDlg(char* ch)
  40. {
  41. m_showdata=ch;
  42. }
  43. int SoftAuth::OnCreate(LPCREATESTRUCT lpCreateStruct)
  44. {
  45. if (CDialogEx::OnCreate(lpCreateStruct) == -1)
  46. return -1;
  47. return 0;
  48. }
  49. BOOL SoftAuth::OnInitDialog()
  50. {
  51. CDialogEx::OnInitDialog();
  52. m_show.SetWindowText(m_showdata);
  53. return TRUE; // return TRUE unless you set the focus to a control
  54. // 异常: OCX 属性页应返回 FALSE
  55. }