ServerStatusDlg.cpp
上传用户:fuyouda
上传日期:2015-08-19
资源大小:6876k
文件大小:2k
源码类别:

家庭/个人应用

开发平台:

Visual C++

  1. // ServerStatusDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "DAC_VCDEMO.h"
  5. #include "ServerStatusDlg.h"
  6. #include "DACLTSDK.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // ServerStatusDlg dialog
  14. ServerStatusDlg::ServerStatusDlg(CWnd* pParent /*=NULL*/)
  15. : CDialog(ServerStatusDlg::IDD, pParent)
  16. {
  17. //{{AFX_DATA_INIT(ServerStatusDlg)
  18. //}}AFX_DATA_INIT
  19. }
  20. void ServerStatusDlg::DoDataExchange(CDataExchange* pDX)
  21. {
  22. CDialog::DoDataExchange(pDX);
  23. //{{AFX_DATA_MAP(ServerStatusDlg)
  24. DDX_Control(pDX, IDC_EDIT9, m_Edit9);
  25. DDX_Control(pDX, IDC_EDIT8, m_Edit8);
  26. DDX_Control(pDX, IDC_EDIT7, m_Edit7);
  27. DDX_Control(pDX, IDC_EDIT6, m_Edit6);
  28. DDX_Control(pDX, IDC_EDIT5, m_Edit5);
  29. DDX_Control(pDX, IDC_EDIT4, m_Edit4);
  30. DDX_Control(pDX, IDC_EDIT3, m_Edit3);
  31. DDX_Control(pDX, IDC_EDIT2, m_Edit2);
  32. DDX_Control(pDX, IDC_EDIT1, m_Edit1);
  33. //}}AFX_DATA_MAP
  34. }
  35. BEGIN_MESSAGE_MAP(ServerStatusDlg, CDialog)
  36. //{{AFX_MSG_MAP(ServerStatusDlg)
  37. ON_WM_SHOWWINDOW()
  38. //}}AFX_MSG_MAP
  39. END_MESSAGE_MAP()
  40. /////////////////////////////////////////////////////////////////////////////
  41. // ServerStatusDlg message handlers
  42. void ServerStatusDlg::Refresh()
  43. {
  44. _FILETIME StartTime,CurrentTime,LastUpdateTime;
  45. WORD State, MajorVersion, MinorVersion, BuildNum;
  46. DWORD BandWidth, GroupCount;
  47. char Vendor[128];
  48. if(ASDAC_GetServerStatus(ServerHandle, &StartTime,&CurrentTime,&LastUpdateTime,&State,&BandWidth, &GroupCount, &MajorVersion, &MinorVersion, &BuildNum, Vendor, 128))
  49. {
  50. m_Edit1.SetWindowText(FileTimeToString(StartTime));
  51. m_Edit2.SetWindowText(FileTimeToString(CurrentTime));
  52. m_Edit3.SetWindowText(FileTimeToString(LastUpdateTime));
  53. m_Edit4.SetWindowText(IntToString(BandWidth));
  54. m_Edit5.SetWindowText(IntToString(State));
  55. m_Edit6.SetWindowText(IntToString(GroupCount));
  56. m_Edit7.SetWindowText(IntToString(MajorVersion));
  57. m_Edit8.SetWindowText(IntToString(MinorVersion));
  58. m_Edit9.SetWindowText(IntToString(BuildNum));
  59. }
  60. }
  61. void ServerStatusDlg::OnShowWindow(BOOL bShow, UINT nStatus) 
  62. {
  63. CDialog::OnShowWindow(bShow, nStatus);
  64. Refresh();
  65. }