Source code of Windows XP (NT5)
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.

112 lines
3.5 KiB

  1. // SendMDlg.cpp : implementation file
  2. //
  3. //=--------------------------------------------------------------------------=
  4. // Copyright 1997-1999 Microsoft Corporation. All Rights Reserved.
  5. //
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  7. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  8. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  9. // PARTICULAR PURPOSE.
  10. //=--------------------------------------------------------------------------=
  11. #include "stdafx.h"
  12. #include "MQApitst.h"
  13. #include "SendMDlg.h"
  14. #ifdef _DEBUG
  15. #define new DEBUG_NEW
  16. #undef THIS_FILE
  17. static char THIS_FILE[] = __FILE__;
  18. #endif
  19. /////////////////////////////////////////////////////////////////////////////
  20. // CSendMessageDialog dialog
  21. CSendMessageDialog::CSendMessageDialog(CArray<ARRAYQ*, ARRAYQ*>* pStrArray, CWnd* pParent /*=NULL*/)
  22. : CDialog(CSendMessageDialog::IDD, pParent)
  23. {
  24. m_pStrArray = pStrArray;
  25. //{{AFX_DATA_INIT(CSendMessageDialog)
  26. m_strBody = szLastMessageBody;
  27. m_strLabel = szLastMessageLabel;
  28. m_bPriority = (MQ_MAX_PRIORITY - MQ_MIN_PRIORITY)/2;
  29. m_iAck = MQMSG_ACKNOWLEDGMENT_NONE;
  30. m_iDelivery = MQMSG_DELIVERY_EXPRESS;
  31. m_szPathName = _T("");
  32. m_szAdminPathName = _T("");
  33. m_Journal = FALSE;
  34. m_DeadLetter = FALSE;
  35. m_Authenticated = FALSE;
  36. m_Encrypted = FALSE;
  37. m_dwTimeToReachQueue = (DWORD)DEFAULT_M_TIMETOREACHQUEUE;
  38. m_dwTimeToBeReceived = (DWORD)DEFAULT_M_TIMETOBERECEIVED;
  39. //}}AFX_DATA_INIT
  40. }
  41. void CSendMessageDialog::DoDataExchange(CDataExchange* pDX)
  42. {
  43. CDialog::DoDataExchange(pDX);
  44. //{{AFX_DATA_MAP(CSendMessageDialog)
  45. DDX_Control(pDX, IDC_ADMIN_COMBO, m_AdminPathNameCB);
  46. DDX_Control(pDX, IDC_TARGET_COMBO, m_PathNameCB);
  47. DDX_Text(pDX, IDC_BODY, m_strBody);
  48. DDV_MaxChars(pDX, m_strBody, 128);
  49. DDX_Text(pDX, IDC_LABEL, m_strLabel);
  50. DDV_MaxChars(pDX, m_strLabel, 128);
  51. DDX_Text(pDX, IDC_MESSAGE_PRIORITY, m_bPriority);
  52. DDV_MinMaxByte(pDX, m_bPriority, MQ_MIN_PRIORITY, MQ_MAX_PRIORITY);
  53. DDX_Radio(pDX, IDC_ACK_NONE_RADIO, m_iAck);
  54. DDX_Radio(pDX, IDC_DELIVERY_EXPRESS_RADIO, m_iDelivery);
  55. DDX_CBString(pDX, IDC_TARGET_COMBO, m_szPathName);
  56. DDV_MaxChars(pDX, m_szPathName, 128);
  57. DDX_CBString(pDX, IDC_ADMIN_COMBO, m_szAdminPathName);
  58. DDV_MaxChars(pDX, m_szAdminPathName, 128);
  59. DDX_Check(pDX, IDC_JOURNAL, m_Journal);
  60. DDX_Check(pDX, IDC_DEAD_LETTER, m_DeadLetter);
  61. DDX_Check(pDX, IDC_AUTHENTICATED, m_Authenticated);
  62. DDX_Check(pDX, IDC_ENCRYPTED, m_Encrypted);
  63. DDX_Text(pDX, IDC_TIME_TO_REACH_QUEUE, m_dwTimeToReachQueue);
  64. DDX_Text(pDX, IDC_TIME_TO_BE_RECEIVED, m_dwTimeToBeReceived);
  65. //}}AFX_DATA_MAP
  66. }
  67. BEGIN_MESSAGE_MAP(CSendMessageDialog, CDialog)
  68. //{{AFX_MSG_MAP(CSendMessageDialog)
  69. //}}AFX_MSG_MAP
  70. END_MESSAGE_MAP()
  71. /////////////////////////////////////////////////////////////////////////////
  72. // CSendMessageDialog message handlers
  73. BOOL CSendMessageDialog::OnInitDialog()
  74. {
  75. CDialog::OnInitDialog();
  76. int i;
  77. // TODO: Add extra initialization here
  78. for (i=0 ; i<m_pStrArray->GetSize() ; i++)
  79. {
  80. if (((*m_pStrArray)[i]->dwAccess & MQ_SEND_ACCESS) != FALSE)
  81. {
  82. VERIFY (m_PathNameCB.AddString((*m_pStrArray)[i]->szPathName) != CB_ERR);
  83. }
  84. VERIFY (m_AdminPathNameCB.AddString((*m_pStrArray)[i]->szPathName) != CB_ERR);
  85. }
  86. //
  87. // Set the first PathName as default selection.
  88. //
  89. if (m_PathNameCB.GetCount() > 0) m_PathNameCB.SetCurSel(0);
  90. if (m_AdminPathNameCB.GetCount() > 0) m_AdminPathNameCB.SetCurSel(0);
  91. return TRUE; // return TRUE unless you set the focus to a control
  92. // EXCEPTION: OCX Property Pages should return FALSE
  93. }