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.

96 lines
2.1 KiB

  1. // DlgTIFF.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ConfigTest.h"
  5. #include "DlgTIFF.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. // CDlgTIFF dialog
  16. CDlgTIFF::CDlgTIFF(HANDLE hFax, CWnd* pParent /*=NULL*/)
  17. : CDialog(CDlgTIFF::IDD, pParent), m_hFax (hFax)
  18. {
  19. //{{AFX_DATA_INIT(CDlgTIFF)
  20. m_cstrDstFile = _T("");
  21. m_iFolder = 0;
  22. m_cstrMsgId = _T("");
  23. //}}AFX_DATA_INIT
  24. }
  25. void CDlgTIFF::DoDataExchange(CDataExchange* pDX)
  26. {
  27. CDialog::DoDataExchange(pDX);
  28. //{{AFX_DATA_MAP(CDlgTIFF)
  29. DDX_Text(pDX, IDC_DESTFILE, m_cstrDstFile);
  30. DDX_Radio(pDX, IDC_INBOX, m_iFolder);
  31. DDX_Text(pDX, IDC_MGSID, m_cstrMsgId);
  32. //}}AFX_DATA_MAP
  33. }
  34. BEGIN_MESSAGE_MAP(CDlgTIFF, CDialog)
  35. //{{AFX_MSG_MAP(CDlgTIFF)
  36. ON_BN_CLICKED(IDC_COPY, OnCopy)
  37. //}}AFX_MSG_MAP
  38. END_MESSAGE_MAP()
  39. /////////////////////////////////////////////////////////////////////////////
  40. // CDlgTIFF message handlers
  41. void CDlgTIFF::OnCopy()
  42. {
  43. if (!UpdateData ())
  44. {
  45. return;
  46. }
  47. DWORDLONG dwlMsgId;
  48. if (1 != sscanf (m_cstrMsgId, "%I64ld", &dwlMsgId))
  49. {
  50. return;
  51. }
  52. if (!strlen (m_cstrDstFile))
  53. {
  54. return;
  55. }
  56. FAX_ENUM_MESSAGE_FOLDER Folder;
  57. switch (m_iFolder)
  58. {
  59. case 0:
  60. Folder = FAX_MESSAGE_FOLDER_INBOX;
  61. break;
  62. case 1:
  63. Folder = FAX_MESSAGE_FOLDER_SENTITEMS;
  64. break;
  65. case 2:
  66. Folder = FAX_MESSAGE_FOLDER_QUEUE;
  67. break;
  68. default:
  69. return;
  70. }
  71. if (!FaxGetMessageTiff (m_hFax, dwlMsgId, Folder, m_cstrDstFile))
  72. {
  73. CString cs;
  74. cs.Format ("Failed while calling FaxGetMessageTiff (%ld)", GetLastError());
  75. AfxMessageBox (cs, MB_OK | MB_ICONHAND);
  76. return;
  77. }
  78. else
  79. {
  80. AfxMessageBox ("TIFF successfully copied", MB_OK | MB_ICONHAND);
  81. }
  82. }