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.

181 lines
6.0 KiB

  1. //#--------------------------------------------------------------
  2. //
  3. // File: localuicontrols.cpp
  4. //
  5. // Synopsis: This file holds the declaration and implmentation of the
  6. // of control events class
  7. //
  8. // History: 12/15/2000 serdarun Created
  9. //
  10. // Copyright (C) 1999-2000 Microsoft Corporation
  11. // All rights reserved.
  12. //
  13. //#--------------------------------------------------------------
  14. #ifndef _LOCALUICONTROLSCP_H_
  15. #define _LOCALUICONTROLSCP_H_
  16. template <class T>
  17. class CProxy_ISADataEntryCtrlEvents : public IConnectionPointImpl<T, &DIID__ISADataEntryCtrlEvents, CComDynamicUnkArray>
  18. {
  19. //Warning this class may be recreated by the wizard.
  20. public:
  21. HRESULT Fire_DataEntered()
  22. {
  23. CComVariant varResult;
  24. T* pT = static_cast<T*>(this);
  25. int nConnectionIndex;
  26. int nConnections = m_vec.GetSize();
  27. for (nConnectionIndex = nConnections-1; nConnectionIndex >= 0; nConnectionIndex--)
  28. {
  29. pT->Lock();
  30. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  31. pT->Unlock();
  32. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  33. if (pDispatch != NULL)
  34. {
  35. VariantClear(&varResult);
  36. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  37. pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL);
  38. break;
  39. }
  40. }
  41. return varResult.scode;
  42. }
  43. HRESULT Fire_OperationCanceled()
  44. {
  45. CComVariant varResult;
  46. T* pT = static_cast<T*>(this);
  47. int nConnectionIndex;
  48. int nConnections = m_vec.GetSize();
  49. for (nConnectionIndex = nConnections-1; nConnectionIndex >= 0; nConnectionIndex--)
  50. {
  51. pT->Lock();
  52. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  53. pT->Unlock();
  54. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  55. if (pDispatch != NULL)
  56. {
  57. VariantClear(&varResult);
  58. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  59. pDispatch->Invoke(0x2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL);
  60. break;
  61. }
  62. }
  63. return varResult.scode;
  64. }
  65. HRESULT Fire_KeyPressed()
  66. {
  67. CComVariant varResult;
  68. T* pT = static_cast<T*>(this);
  69. int nConnectionIndex;
  70. int nConnections = m_vec.GetSize();
  71. for (nConnectionIndex = nConnections-1; nConnectionIndex >= 0; nConnectionIndex--)
  72. {
  73. pT->Lock();
  74. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  75. pT->Unlock();
  76. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  77. if (pDispatch != NULL)
  78. {
  79. VariantClear(&varResult);
  80. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  81. pDispatch->Invoke(0x3, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL);
  82. break;
  83. }
  84. }
  85. return varResult.scode;
  86. }
  87. };
  88. template <class T>
  89. class CProxy_IStaticIpEvents : public IConnectionPointImpl<T, &DIID__IStaticIpEvents, CComDynamicUnkArray>
  90. {
  91. //Warning this class may be recreated by the wizard.
  92. public:
  93. HRESULT Fire_StaticIpEntered()
  94. {
  95. CComVariant varResult;
  96. T* pT = static_cast<T*>(this);
  97. int nConnectionIndex;
  98. int nConnections = m_vec.GetSize();
  99. for (nConnectionIndex = nConnections-1; nConnectionIndex >= 0; nConnectionIndex--)
  100. {
  101. pT->Lock();
  102. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  103. pT->Unlock();
  104. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  105. if (pDispatch != NULL)
  106. {
  107. VariantClear(&varResult);
  108. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  109. pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL);
  110. break;
  111. }
  112. }
  113. return varResult.scode;
  114. }
  115. HRESULT Fire_OperationCanceled()
  116. {
  117. CComVariant varResult;
  118. T* pT = static_cast<T*>(this);
  119. int nConnectionIndex;
  120. int nConnections = m_vec.GetSize();
  121. for (nConnectionIndex = nConnections-1; nConnectionIndex >= 0; nConnectionIndex--)
  122. {
  123. pT->Lock();
  124. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  125. pT->Unlock();
  126. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  127. if (pDispatch != NULL)
  128. {
  129. VariantClear(&varResult);
  130. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  131. pDispatch->Invoke(0x2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL);
  132. break;
  133. }
  134. }
  135. return varResult.scode;
  136. }
  137. HRESULT Fire_KeyPressed()
  138. {
  139. CComVariant varResult;
  140. T* pT = static_cast<T*>(this);
  141. int nConnectionIndex;
  142. int nConnections = m_vec.GetSize();
  143. for (nConnectionIndex = nConnections-1; nConnectionIndex >= 0; nConnectionIndex--)
  144. {
  145. pT->Lock();
  146. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  147. pT->Unlock();
  148. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  149. if (pDispatch != NULL)
  150. {
  151. VariantClear(&varResult);
  152. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  153. pDispatch->Invoke(0x3, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL);
  154. break;
  155. }
  156. }
  157. return varResult.scode;
  158. }
  159. };
  160. #endif