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.

87 lines
2.4 KiB

  1. // DlgActivityLogging.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ConfigTest.h"
  5. #include "DlgActivityLogging.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. // CDlgActivityLogging dialog
  16. CDlgActivityLogging::CDlgActivityLogging(HANDLE hFax, CWnd* pParent /*=NULL*/)
  17. : CDialog(CDlgActivityLogging::IDD, pParent), m_hFax (hFax)
  18. {
  19. //{{AFX_DATA_INIT(CDlgActivityLogging)
  20. m_bIn = FALSE;
  21. m_bOut = FALSE;
  22. m_strDBFile = _T("");
  23. //}}AFX_DATA_INIT
  24. }
  25. void CDlgActivityLogging::DoDataExchange(CDataExchange* pDX)
  26. {
  27. CDialog::DoDataExchange(pDX);
  28. //{{AFX_DATA_MAP(CDlgActivityLogging)
  29. DDX_Check(pDX, IDC_CHK_IN, m_bIn);
  30. DDX_Check(pDX, IDC_CHK_OUT, m_bOut);
  31. DDX_Text(pDX, IDC_DBFILE, m_strDBFile);
  32. //}}AFX_DATA_MAP
  33. }
  34. BEGIN_MESSAGE_MAP(CDlgActivityLogging, CDialog)
  35. //{{AFX_MSG_MAP(CDlgActivityLogging)
  36. ON_BN_CLICKED(IDC_READ, OnRead)
  37. ON_BN_CLICKED(IDC_WRITE, OnWrite)
  38. //}}AFX_MSG_MAP
  39. END_MESSAGE_MAP()
  40. /////////////////////////////////////////////////////////////////////////////
  41. // CDlgActivityLogging message handlers
  42. void CDlgActivityLogging::OnRead()
  43. {
  44. PFAX_ACTIVITY_LOGGING_CONFIG pCfg;
  45. if (!FaxGetActivityLoggingConfiguration (m_hFax, &pCfg))
  46. {
  47. CString cs;
  48. cs.Format ("Failed while calling FaxGetActivityLoggingConfiguration (%ld)", GetLastError());
  49. AfxMessageBox (cs, MB_OK | MB_ICONHAND);
  50. return;
  51. }
  52. m_strDBFile = pCfg->lptstrDBPath;
  53. m_bIn = pCfg->bLogIncoming;
  54. m_bOut = pCfg->bLogOutgoing;
  55. UpdateData (FALSE);
  56. FaxFreeBuffer (LPVOID(pCfg));
  57. }
  58. void CDlgActivityLogging::OnWrite()
  59. {
  60. UpdateData ();
  61. FAX_ACTIVITY_LOGGING_CONFIG cfg;
  62. cfg.dwSizeOfStruct = sizeof (FAX_ACTIVITY_LOGGING_CONFIG);
  63. cfg.lptstrDBPath = LPTSTR(LPCTSTR(m_strDBFile));
  64. cfg.bLogIncoming = m_bIn;
  65. cfg.bLogOutgoing = m_bOut;
  66. if (!FaxSetActivityLoggingConfiguration (m_hFax, &cfg))
  67. {
  68. CString cs;
  69. cs.Format ("Failed while calling FaxSetActivityLoggingConfiguration (%ld)", GetLastError());
  70. AfxMessageBox (cs, MB_OK | MB_ICONHAND);
  71. return;
  72. }
  73. }