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.

230 lines
5.5 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. // FILE : CppFaxProviderGeneral.cpp //
  3. // //
  4. // DESCRIPTION : prop pages of Catalog's Inbox Routing Method //
  5. // //
  6. // AUTHOR : yossg //
  7. // //
  8. // HISTORY : //
  9. // Jan 31 2000 yossg Created //
  10. // //
  11. // Copyright (C) 1999 - 2000 Microsoft Corporation All Rights Reserved //
  12. /////////////////////////////////////////////////////////////////////////////
  13. #include "stdafx.h"
  14. #include "MSFxsSnp.h"
  15. #include "ppFaxProviderGeneral.h"
  16. #include "FaxMMCGlobals.h"
  17. #ifdef _DEBUG
  18. #undef THIS_FILE
  19. static char THIS_FILE[] = __FILE__;
  20. #endif
  21. //
  22. // Constructor
  23. //
  24. CppFaxProvider::CppFaxProvider(
  25. long hNotificationHandle,
  26. CSnapInItem *pNode,
  27. BOOL bOwnsNotificationHandle,
  28. HINSTANCE hInst)
  29. : CPropertyPageExImpl<CppFaxProvider>(pNode, NULL)
  30. {
  31. m_lpNotifyHandle = hNotificationHandle;
  32. }
  33. //
  34. // Destructor
  35. //
  36. CppFaxProvider::~CppFaxProvider()
  37. {
  38. // Note - This needs to be called only once per property sheet.
  39. // In our convention called in the general tab.
  40. if (NULL != m_lpNotifyHandle)
  41. {
  42. MMCFreeNotifyHandle(m_lpNotifyHandle);
  43. m_lpNotifyHandle = NULL;
  44. }
  45. }
  46. /////////////////////////////////////////////////////////////////////////////
  47. // CppFaxProvider message handlers
  48. /*
  49. - CppFaxProvider::Init
  50. -
  51. * Purpose:
  52. * Initiates all members
  53. *
  54. * Arguments:
  55. *
  56. * Return:
  57. * OLE error code
  58. */
  59. HRESULT CppFaxProvider::Init(CComBSTR bstrName, CComBSTR bstrStatus, CComBSTR bstrVersion, CComBSTR bstrPath)
  60. {
  61. DEBUG_FUNCTION_NAME( _T("CppFaxProvider::Init"));
  62. HRESULT hRc = S_OK;
  63. m_bstrName = bstrName;
  64. if (!m_bstrName)
  65. {
  66. DebugPrintEx( DEBUG_ERR, _T("Null m_bstrName - out of memory."));
  67. goto Error;
  68. }
  69. m_bstrStatus = bstrStatus;
  70. if (!m_bstrStatus)
  71. {
  72. DebugPrintEx( DEBUG_ERR, _T("Null m_bstrStatus - out of memory."));
  73. goto Error;
  74. }
  75. m_bstrVersion = bstrVersion;
  76. if (!m_bstrVersion)
  77. {
  78. DebugPrintEx( DEBUG_ERR, _T("Null m_bstrVersion - out of memory."));
  79. goto Error;
  80. }
  81. m_bstrPath = bstrPath;
  82. if (!m_bstrPath)
  83. {
  84. DebugPrintEx( DEBUG_ERR, _T("Null m_bstrPath - out of memory."));
  85. goto Error;
  86. }
  87. goto Exit;
  88. Error:
  89. hRc = E_OUTOFMEMORY;
  90. Exit:
  91. return hRc;
  92. }
  93. /*
  94. - CppFaxProvider::OnInitDialog
  95. -
  96. * Purpose:
  97. * Initiates all controls when dialog is called.
  98. *
  99. * Arguments:
  100. *
  101. * Return:
  102. *
  103. */
  104. LRESULT CppFaxProvider::OnInitDialog( UINT uiMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled )
  105. {
  106. DEBUG_FUNCTION_NAME( _T("CppFaxProvider::PageInitDialog"));
  107. UNREFERENCED_PARAMETER( uiMsg );
  108. UNREFERENCED_PARAMETER( wParam );
  109. UNREFERENCED_PARAMETER( lParam );
  110. UNREFERENCED_PARAMETER( fHandled );
  111. //
  112. // Version
  113. //
  114. SetDlgItemText(IDC_FSPVERSION_EDIT, m_bstrVersion);
  115. //
  116. // Status
  117. //
  118. SetDlgItemText(IDC_FSPSTATUS_EDIT, m_bstrStatus);
  119. //
  120. // DLL's full path
  121. //
  122. SetDlgItemText(IDC_FSPVPATH_EDIT, m_bstrPath);
  123. return (1);
  124. }
  125. /*
  126. - CppFaxProvider::OnApply
  127. -
  128. * Purpose:
  129. * Calls PreApply and SetProp to Apply changes.
  130. *
  131. * Arguments:
  132. *
  133. * Return:
  134. * TRUE or FALSE
  135. */
  136. BOOL CppFaxProvider::OnApply()
  137. {
  138. return TRUE;
  139. }
  140. /*
  141. - CppFaxProvider::SetApplyButton
  142. -
  143. * Purpose:
  144. * set Apply buttom modified.
  145. *
  146. * Arguments:
  147. *
  148. * Return:
  149. * 1
  150. */
  151. LRESULT CppFaxProvider::SetApplyButton(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
  152. {
  153. SetModified(TRUE);
  154. bHandled = TRUE;
  155. return(1);
  156. }
  157. //////////////////////////////////////////////////////////////////////////////
  158. /*++
  159. CppFaxProvider::OnHelpRequest
  160. This is called in response to the WM_HELP Notify
  161. message and to the WM_CONTEXTMENU Notify message.
  162. WM_HELP Notify message.
  163. This message is sent when the user presses F1 or <Shift>-F1
  164. over an item or when the user clicks on the ? icon and then
  165. presses the mouse over an item.
  166. WM_CONTEXTMENU Notify message.
  167. This message is sent when the user right clicks over an item
  168. and then clicks "What's this?"
  169. --*/
  170. /////////////////////////////////////////////////////////////////////////////
  171. LRESULT
  172. CppFaxProvider::OnHelpRequest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
  173. {
  174. DEBUG_FUNCTION_NAME(_T("CppFaxProvider::OnHelpRequest"));
  175. switch (uMsg)
  176. {
  177. case WM_HELP:
  178. WinContextHelp(((LPHELPINFO)lParam)->dwContextId, m_hWnd);
  179. break;
  180. case WM_CONTEXTMENU:
  181. WinContextHelp(::GetWindowContextHelpId((HWND)wParam), m_hWnd);
  182. break;
  183. }
  184. return TRUE;
  185. }
  186. /////////////////////////////////////////////////////////////////////////////