12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- // InputCode.cpp : implementation file
- //
- #include "stdafx.h"
- #include "dbserver.h"
- #include "InputCode.h"
- #include "my32.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // InputCode dialog
- InputCode::InputCode(CWnd* pParent /*=NULL*/)
- : CDialog(InputCode::IDD, pParent)
- {
- //{{AFX_DATA_INIT(InputCode)
- m_code = _T("");
- //}}AFX_DATA_INIT
- }
- void InputCode::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(InputCode)
- DDX_Text(pDX, IDC_EDIT1, m_code);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(InputCode, CDialog)
- //{{AFX_MSG_MAP(InputCode)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // InputCode message handlers
- void InputCode::OnOK() // 医院跟踪系统注册;
- {
- UpdateData();
- DWORD code=atoi(m_code);
- code^=0x19900101;
- DWORD id;
- TCHAR DevicePath[ 260];
- if(FindPort(0,DevicePath)!=0)return;
- int version;
- GetIDVersion(&id, &version, DevicePath);
- if(id!=code)
- {
- MessageBox("验证码错误!");
- return;
- }
- BOOL ret;
- ///////限座席数
- CString str;
- str.Format ("%d", 1);
- char name[32];
- memset(name, 0, 32);
- strcpy(name, str);
- // 写密码:h.E4F08542,l.87E5CED0
- ret=YtWriteString (name, 330 ,"E4F08542", "87E5CED0", DevicePath);
- if(ret<=0)//成功写入ret等于字串长度+1
- {
- MessageBox("出错!");
- }
- ////////////
- AfxMessageBox("注册成功! 感谢您的注册, 重启服务器程序和客户端软件生效!", MB_ICONINFORMATION);
- g_bReg=1;
- CDialog::OnOK();
- }
|