WizSetCfgPage.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #include "stdafx2.h"
  2. #include "WizSetCfgPage.h"
  3. CWizSetCfgPage::CWizSetCfgPage(IInitializeService* pService)
  4. :m_pInitService(pService), m_nCenterSettingPort(1024)
  5. {
  6. }
  7. CWizSetCfgPage::~CWizSetCfgPage(void)
  8. {
  9. }
  10. //////////////////////////////////////////////////////////////////////
  11. // Message handlers
  12. BOOL CWizSetCfgPage::OnInitDialog ( HWND hwndFocus, LPARAM lParam )
  13. {
  14. DoDataExchange(false);
  15. SetMsgHandled(FALSE);
  16. return TRUE;
  17. }
  18. //////////////////////////////////////////////////////////////////////
  19. // Notification handlers
  20. int CWizSetCfgPage::OnSetActive()
  21. {
  22. SetWizardButtons (PSWIZB_FINISH);
  23. // 0 = allow activate
  24. // -1 = go back to page that was active
  25. // page ID = jump to page
  26. return 0;
  27. }
  28. INT_PTR CWizSetCfgPage::OnWizardFinish()
  29. {
  30. // FALSE = allow finish
  31. // TRUE = prevent finish
  32. // HWND = prevent finish and set focus to HWND (CommCtrl 5.80 only)
  33. if (!DoDataExchange(TRUE) || m_strCenterSettingServer1.IsEmpty() || m_nCenterSettingPort <=0)
  34. {
  35. MessageBoxA("输入数据校验不通过,请重新输入");
  36. return TRUE;
  37. }
  38. if (!m_pInitService->AsyncInitCenterSetting(m_strCenterSettingServer1, m_strCenterSettingServer2, m_nCenterSettingPort))
  39. {
  40. MessageBoxA(CSimpleStringA::Format("初始化集中配置失败, %s", m_pInitService->GetLastErrMsg()));
  41. return TRUE;
  42. }
  43. return TRUE;
  44. }