Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.1 KiB

  1. // DlgVersion.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ConfigTest.h"
  5. #include "DlgVersion.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. typedef unsigned long ULONG_PTR, *PULONG_PTR;
  12. typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR;
  13. #include "..\..\..\inc\fxsapip.h"
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CDlgVersion dialog
  16. CDlgVersion::CDlgVersion(HANDLE hFax, CWnd* pParent /*=NULL*/)
  17. : CDialog(CDlgVersion::IDD, pParent), m_hFax (hFax)
  18. {
  19. //{{AFX_DATA_INIT(CDlgVersion)
  20. m_cstrVersion = _T("");
  21. //}}AFX_DATA_INIT
  22. }
  23. void CDlgVersion::DoDataExchange(CDataExchange* pDX)
  24. {
  25. CDialog::DoDataExchange(pDX);
  26. //{{AFX_DATA_MAP(CDlgVersion)
  27. DDX_Text(pDX, IDC_SERVERVERSION, m_cstrVersion);
  28. //}}AFX_DATA_MAP
  29. }
  30. BEGIN_MESSAGE_MAP(CDlgVersion, CDialog)
  31. //{{AFX_MSG_MAP(CDlgVersion)
  32. //}}AFX_MSG_MAP
  33. END_MESSAGE_MAP()
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CDlgVersion message handlers
  36. BOOL CDlgVersion::OnInitDialog()
  37. {
  38. CDialog::OnInitDialog();
  39. FAX_VERSION ver;
  40. ver.dwSizeOfStruct = sizeof (FAX_VERSION);
  41. if (!FaxGetVersion (m_hFax, &ver))
  42. {
  43. CString cs;
  44. cs.Format ("Failed while calling FaxGetVersion (%ld)", GetLastError());
  45. AfxMessageBox (cs, MB_OK | MB_ICONHAND);
  46. EndDialog (-1);
  47. return FALSE;
  48. }
  49. if (ver.bValid)
  50. {
  51. //
  52. // Version info exists
  53. //
  54. m_cstrVersion.Format ("%ld.%ld.%ld.%ld (%s)",
  55. ver.wMajorVersion,
  56. ver.wMinorVersion,
  57. ver.wMajorBuildNumber,
  58. ver.wMinorBuildNumber,
  59. (ver.dwFlags & FAX_VER_FLAG_CHECKED) ? "checked" : "free");
  60. }
  61. else
  62. {
  63. m_cstrVersion = "<no version data>";
  64. }
  65. UpdateData (FALSE);
  66. return TRUE; // return TRUE unless you set the focus to a control
  67. // EXCEPTION: OCX Property Pages should return FALSE
  68. }