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.

202 lines
3.4 KiB

  1. /******************************************************************************
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. impl.cpp
  5. Abstract:
  6. This file contains the implementation of the CPCHLaunch class.
  7. Revision History:
  8. Davide Massarenti (Dmassare) 04/15/2000
  9. created
  10. ******************************************************************************/
  11. #include "StdAfx.h"
  12. ////////////////////////////////////////////////////////////////////////////////
  13. CPCHLaunch::CPCHLaunch()
  14. {
  15. // HCAPI::CmdData m_data;
  16. // HCAPI::Locator m_loc;
  17. }
  18. ////////////////////////////////////////////////////////////////////////////////
  19. STDMETHODIMP CPCHLaunch::SetMode( /*[in]*/ DWORD dwFlags )
  20. {
  21. __HCP_FUNC_ENTRY( "CPCHLaunch::SetMode" );
  22. m_data.m_fMode = true;
  23. m_data.m_dwFlags = dwFlags;
  24. __HCP_FUNC_EXIT(S_OK);
  25. }
  26. STDMETHODIMP CPCHLaunch::SetParentWindow( /*[in]*/ HWND hwndParent )
  27. {
  28. __HCP_FUNC_ENTRY( "CPCHLaunch::SetParentWindow" );
  29. m_data.m_fWindow = true;
  30. m_data.m_hwndParent = hwndParent;
  31. __HCP_FUNC_EXIT(S_OK);
  32. }
  33. STDMETHODIMP CPCHLaunch::SetSizeInfo( /*[in]*/ LONG lX, /*[in]*/ LONG lY, /*[in]*/ LONG lWidth, /*[in]*/ LONG lHeight )
  34. {
  35. __HCP_FUNC_ENTRY( "CPCHLaunch::SetSizeInfo" );
  36. m_data.m_fSize = true;
  37. m_data.m_lX = lX;
  38. m_data.m_lY = lY;
  39. m_data.m_lWidth = lWidth;
  40. m_data.m_lHeight = lHeight;
  41. __HCP_FUNC_EXIT(S_OK);
  42. }
  43. STDMETHODIMP CPCHLaunch::SetContext( /*[in]*/ BSTR bstrCtxName, /*[in]*/ BSTR bstrCtxInfo )
  44. {
  45. __HCP_FUNC_ENTRY( "CPCHLaunch::SetContext" );
  46. m_data.m_fCtx = true;
  47. m_data.m_bstrCtxName = bstrCtxName;
  48. m_data.m_bstrCtxInfo = bstrCtxInfo;
  49. __HCP_FUNC_EXIT(S_OK);
  50. }
  51. STDMETHODIMP CPCHLaunch::DisplayTopic( /*[in]*/ BSTR bstrURL )
  52. {
  53. __HCP_FUNC_ENTRY( "CPCHLaunch::DisplayTopic" );
  54. HRESULT hr;
  55. __MPC_PARAMCHECK_BEGIN(hr)
  56. __MPC_PARAMCHECK_STRING_NOT_EMPTY(bstrURL);
  57. __MPC_PARAMCHECK_END();
  58. m_data.m_fURL = true;
  59. m_data.m_bstrURL = bstrURL;
  60. __MPC_EXIT_IF_METHOD_FAILS(hr, m_loc.ExecCommand( m_data ));
  61. hr = S_OK;
  62. __HCP_FUNC_CLEANUP;
  63. __HCP_FUNC_EXIT(hr);
  64. }
  65. STDMETHODIMP CPCHLaunch::DisplayError( /*[in]*/ REFCLSID rclsid )
  66. {
  67. __HCP_FUNC_ENTRY( "CPCHLaunch::DisplayError" );
  68. HRESULT hr;
  69. m_data.m_fError = true;
  70. m_data.m_clsidError = rclsid;
  71. __MPC_EXIT_IF_METHOD_FAILS(hr, m_loc.ExecCommand( m_data ));
  72. hr = S_OK;
  73. __HCP_FUNC_CLEANUP;
  74. __HCP_FUNC_EXIT(hr);
  75. }
  76. STDMETHODIMP CPCHLaunch::IsOpen( /*[out]*/ BOOL *pVal )
  77. {
  78. __HCP_FUNC_ENTRY( "CPCHLaunch::IsOpen" );
  79. HRESULT hr;
  80. bool fOpen;
  81. __MPC_PARAMCHECK_BEGIN(hr)
  82. __MPC_PARAMCHECK_POINTER_AND_SET(pVal,FALSE);
  83. __MPC_PARAMCHECK_END();
  84. __MPC_EXIT_IF_METHOD_FAILS(hr, m_loc.IsOpen( fOpen, &m_data.m_clsidCaller ));
  85. *pVal = fOpen ? TRUE : FALSE;
  86. hr = S_OK;
  87. __HCP_FUNC_CLEANUP;
  88. __HCP_FUNC_EXIT(hr);
  89. }
  90. STDMETHODIMP CPCHLaunch::PopUp()
  91. {
  92. __HCP_FUNC_ENTRY( "CPCHLaunch::PopUp" );
  93. HRESULT hr;
  94. __MPC_EXIT_IF_METHOD_FAILS(hr, m_loc.PopUp());
  95. hr = S_OK;
  96. __HCP_FUNC_CLEANUP;
  97. __HCP_FUNC_EXIT(hr);
  98. }
  99. STDMETHODIMP CPCHLaunch::Close()
  100. {
  101. __HCP_FUNC_ENTRY( "CPCHLaunch::Close" );
  102. HRESULT hr;
  103. __MPC_EXIT_IF_METHOD_FAILS(hr, m_loc.Close());
  104. hr = S_OK;
  105. __HCP_FUNC_CLEANUP;
  106. __HCP_FUNC_EXIT(hr);
  107. }
  108. STDMETHODIMP CPCHLaunch::WaitForTermination( /*[in]*/ DWORD dwTimeout )
  109. {
  110. __HCP_FUNC_ENTRY( "CPCHLaunch::WaitForTermination" );
  111. HRESULT hr;
  112. __MPC_EXIT_IF_METHOD_FAILS(hr, m_loc.WaitForTermination( dwTimeout ));
  113. hr = S_OK;
  114. __HCP_FUNC_CLEANUP;
  115. __HCP_FUNC_EXIT(hr);
  116. }