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.

119 lines
3.6 KiB

  1. // OutboxDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ConfigTest.h"
  5. #include "OutboxDlg.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. // COutboxDlg dialog
  16. COutboxDlg::COutboxDlg(HANDLE hFax, CWnd* pParent /*=NULL*/)
  17. : CDialog(COutboxDlg::IDD, pParent), m_hFax (hFax)
  18. {
  19. //{{AFX_DATA_INIT(COutboxDlg)
  20. m_bBranding = FALSE;
  21. m_dwAgeLimit = 0;
  22. m_dwEndHour = 0;
  23. m_dwEndMinute = 0;
  24. m_bPersonalCP = FALSE;
  25. m_dwRetries = 0;
  26. m_dwRetryDelay = 0;
  27. m_dwStartHour = 0;
  28. m_dwStartMinute = 0;
  29. m_bUseDeviceTsid = FALSE;
  30. //}}AFX_DATA_INIT
  31. }
  32. void COutboxDlg::DoDataExchange(CDataExchange* pDX)
  33. {
  34. CDialog::DoDataExchange(pDX);
  35. //{{AFX_DATA_MAP(COutboxDlg)
  36. DDX_Check(pDX, IDC_BRANDING, m_bBranding);
  37. DDX_Text(pDX, IDC_AGELIMIT, m_dwAgeLimit);
  38. DDX_Text(pDX, IDC_ENDH, m_dwEndHour);
  39. DDV_MinMaxUInt(pDX, m_dwEndHour, 0, 23);
  40. DDX_Text(pDX, IDC_ENDM, m_dwEndMinute);
  41. DDV_MinMaxUInt(pDX, m_dwEndMinute, 0, 59);
  42. DDX_Check(pDX, IDC_PERSONALCP, m_bPersonalCP);
  43. DDX_Text(pDX, IDC_RETRIES, m_dwRetries);
  44. DDX_Text(pDX, IDC_RETRYDELAY, m_dwRetryDelay);
  45. DDX_Text(pDX, IDC_STARTH, m_dwStartHour);
  46. DDV_MinMaxUInt(pDX, m_dwStartHour, 0, 23);
  47. DDX_Text(pDX, IDC_STARTM, m_dwStartMinute);
  48. DDV_MinMaxUInt(pDX, m_dwStartMinute, 0, 59);
  49. DDX_Check(pDX, IDC_USERDEVICETSID, m_bUseDeviceTsid);
  50. //}}AFX_DATA_MAP
  51. }
  52. BEGIN_MESSAGE_MAP(COutboxDlg, CDialog)
  53. //{{AFX_MSG_MAP(COutboxDlg)
  54. ON_BN_CLICKED(IDC_READ, OnRead)
  55. ON_BN_CLICKED(IDC_WRITE, OnWrite)
  56. //}}AFX_MSG_MAP
  57. END_MESSAGE_MAP()
  58. /////////////////////////////////////////////////////////////////////////////
  59. // COutboxDlg message handlers
  60. void COutboxDlg::OnRead()
  61. {
  62. PFAX_OUTBOX_CONFIG pCfg;
  63. if (!FaxGetOutboxConfiguration (m_hFax, &pCfg))
  64. {
  65. CString cs;
  66. cs.Format ("Failed while calling FaxGetOutboxConfiguration (%ld)", GetLastError());
  67. AfxMessageBox (cs, MB_OK | MB_ICONHAND);
  68. return;
  69. }
  70. m_bPersonalCP = pCfg->bAllowPersonalCP;
  71. m_bUseDeviceTsid = pCfg->bUseDeviceTSID;
  72. m_dwRetries = pCfg->dwRetries;
  73. m_dwRetryDelay = pCfg->dwRetryDelay;
  74. m_dwStartHour = pCfg->dtDiscountStart.Hour;
  75. m_dwStartMinute = pCfg->dtDiscountStart.Minute;
  76. m_dwEndHour = pCfg->dtDiscountEnd.Hour;
  77. m_dwEndMinute = pCfg->dtDiscountEnd.Minute;
  78. m_dwAgeLimit = pCfg->dwAgeLimit;
  79. m_bBranding = pCfg->bBranding;
  80. UpdateData (FALSE);
  81. FaxFreeBuffer (LPVOID(pCfg));
  82. }
  83. void COutboxDlg::OnWrite()
  84. {
  85. UpdateData ();
  86. FAX_OUTBOX_CONFIG cfg;
  87. cfg.dwSizeOfStruct = sizeof (FAX_OUTBOX_CONFIG);
  88. cfg.bAllowPersonalCP = m_bPersonalCP;
  89. cfg.bUseDeviceTSID = m_bUseDeviceTsid;
  90. cfg.dwRetries = m_dwRetries;
  91. cfg.dwRetryDelay = m_dwRetryDelay;
  92. cfg.dtDiscountStart.Hour = m_dwStartHour;
  93. cfg.dtDiscountStart.Minute = m_dwStartMinute;
  94. cfg.dtDiscountEnd.Hour = m_dwEndHour;
  95. cfg.dtDiscountEnd.Minute = m_dwEndMinute;
  96. cfg.dwAgeLimit = m_dwAgeLimit;
  97. cfg.bBranding = m_bBranding;
  98. if (!FaxSetOutboxConfiguration (m_hFax, &cfg))
  99. {
  100. CString cs;
  101. cs.Format ("Failed while calling FaxSetOutboxConfiguration (%ld)", GetLastError());
  102. AfxMessageBox (cs, MB_OK | MB_ICONHAND);
  103. return;
  104. }
  105. }