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.

430 lines
12 KiB

  1. // Copyright (c) 1999 Microsoft Corporation. All Rights Reserved.
  2. #ifndef _MSMFCNTCP_H_
  3. #define _MSMFCNTCP_H_
  4. template <class T>
  5. class CProxy_IMSMFBBtn : public IConnectionPointImpl<T, &DIID__IMSMFBBtn, CComDynamicUnkArray>
  6. {
  7. //Warning this class may be recreated by the wizard.
  8. public:
  9. VOID Fire_OnClick()
  10. {
  11. T* pT = static_cast<T*>(this);
  12. int nConnectionIndex;
  13. int nConnections = m_vec.GetSize();
  14. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  15. {
  16. pT->Lock();
  17. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  18. pT->Unlock();
  19. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  20. if (pDispatch != NULL)
  21. {
  22. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  23. pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  24. }
  25. }
  26. }
  27. };
  28. template <class T>
  29. class CProxy_IMSMFSldr : public IConnectionPointImpl<T, &DIID__IMSMFSldr, CComDynamicUnkArray>
  30. {
  31. //Warning this class may be recreated by the wizard.
  32. public:
  33. VOID Fire_OnClick()
  34. {
  35. T* pT = static_cast<T*>(this);
  36. int nConnectionIndex;
  37. int nConnections = m_vec.GetSize();
  38. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  39. {
  40. pT->Lock();
  41. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  42. pT->Unlock();
  43. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  44. if (pDispatch != NULL)
  45. {
  46. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  47. pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  48. }
  49. }
  50. }
  51. VOID Fire_OnValueChange(FLOAT flNewVal)
  52. {
  53. T* pT = static_cast<T*>(this);
  54. int nConnectionIndex;
  55. CComVariant* pvars = new CComVariant[1];
  56. int nConnections = m_vec.GetSize();
  57. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  58. {
  59. pT->Lock();
  60. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  61. pT->Unlock();
  62. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  63. if (pDispatch != NULL)
  64. {
  65. pvars[0] = flNewVal;
  66. DISPPARAMS disp = { pvars, NULL, 1, 0 };
  67. pDispatch->Invoke(0x2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  68. }
  69. }
  70. delete[] pvars;
  71. }
  72. VOID Fire_OnMouseDown()
  73. {
  74. T* pT = static_cast<T*>(this);
  75. int nConnectionIndex;
  76. int nConnections = m_vec.GetSize();
  77. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  78. {
  79. pT->Lock();
  80. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  81. pT->Unlock();
  82. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  83. if (pDispatch != NULL)
  84. {
  85. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  86. pDispatch->Invoke(0x3, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  87. }
  88. }
  89. }
  90. VOID Fire_OnMouseUp()
  91. {
  92. T* pT = static_cast<T*>(this);
  93. int nConnectionIndex;
  94. int nConnections = m_vec.GetSize();
  95. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  96. {
  97. pT->Lock();
  98. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  99. pT->Unlock();
  100. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  101. if (pDispatch != NULL)
  102. {
  103. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  104. pDispatch->Invoke(0x4, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  105. }
  106. }
  107. }
  108. };
  109. template <class T>
  110. class CProxy_IMSMFText : public IConnectionPointImpl<T, &DIID__IMSMFText, CComDynamicUnkArray>
  111. {
  112. //Warning this class may be recreated by the wizard.
  113. public:
  114. VOID Fire_OnClick()
  115. {
  116. T* pT = static_cast<T*>(this);
  117. int nConnectionIndex;
  118. int nConnections = m_vec.GetSize();
  119. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  120. {
  121. pT->Lock();
  122. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  123. pT->Unlock();
  124. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  125. if (pDispatch != NULL)
  126. {
  127. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  128. pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  129. }
  130. }
  131. }
  132. };
  133. template <class T>
  134. class CProxy_IMSMFBar : public IConnectionPointImpl<T, &DIID__IMSMFBar, CComDynamicUnkArray>
  135. {
  136. //Warning this class may be recreated by the wizard.
  137. public:
  138. VOID Fire_OnResize(LONG lWidth, LONG lHeight, LONG lCode)
  139. {
  140. T* pT = static_cast<T*>(this);
  141. int nConnectionIndex;
  142. CComVariant* pvars = new CComVariant[3];
  143. int nConnections = m_vec.GetSize();
  144. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  145. {
  146. pT->Lock();
  147. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  148. pT->Unlock();
  149. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  150. if (pDispatch != NULL)
  151. {
  152. pvars[2] = lWidth;
  153. pvars[1] = lHeight;
  154. pvars[0] = lCode;
  155. DISPPARAMS disp = { pvars, NULL, 3, 0 };
  156. pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  157. }
  158. }
  159. delete[] pvars;
  160. }
  161. VOID Fire_OnClick()
  162. {
  163. T* pT = static_cast<T*>(this);
  164. int nConnectionIndex;
  165. int nConnections = m_vec.GetSize();
  166. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  167. {
  168. pT->Lock();
  169. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  170. pT->Unlock();
  171. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  172. if (pDispatch != NULL)
  173. {
  174. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  175. pDispatch->Invoke(0x2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  176. }
  177. }
  178. }
  179. VOID Fire_OnHelp(BSTR strObjectID, BSTR strExtraInfo = ::SysAllocString(L""))
  180. {
  181. T* pT = static_cast<T*>(this);
  182. int nConnectionIndex;
  183. CComVariant* pvars = new CComVariant[2];
  184. int nConnections = m_vec.GetSize();
  185. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  186. {
  187. pT->Lock();
  188. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  189. pT->Unlock();
  190. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  191. if (pDispatch != NULL)
  192. {
  193. pvars[1] = strObjectID;
  194. pvars[0] = strExtraInfo;
  195. DISPPARAMS disp = { pvars, NULL, 2, 0 };
  196. pDispatch->Invoke(0x3, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  197. }
  198. }
  199. delete[] pvars;
  200. }
  201. VOID Fire_OnKeyUp(LONG lVirtKey, LONG lKeyData)
  202. {
  203. T* pT = static_cast<T*>(this);
  204. int nConnectionIndex;
  205. CComVariant* pvars = new CComVariant[2];
  206. int nConnections = m_vec.GetSize();
  207. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  208. {
  209. pT->Lock();
  210. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  211. pT->Unlock();
  212. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  213. if (pDispatch != NULL)
  214. {
  215. pvars[1] = lVirtKey;
  216. pvars[0] = lKeyData;
  217. DISPPARAMS disp = { pvars, NULL, 2, 0 };
  218. pDispatch->Invoke(0x4, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  219. }
  220. }
  221. delete[] pvars;
  222. }
  223. VOID Fire_OnKeyDown(LONG lVirtKey, LONG lKeyData)
  224. {
  225. T* pT = static_cast<T*>(this);
  226. int nConnectionIndex;
  227. CComVariant* pvars = new CComVariant[2];
  228. int nConnections = m_vec.GetSize();
  229. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  230. {
  231. pT->Lock();
  232. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  233. pT->Unlock();
  234. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  235. if (pDispatch != NULL)
  236. {
  237. pvars[1] = lVirtKey;
  238. pvars[0] = lKeyData;
  239. DISPPARAMS disp = { pvars, NULL, 2, 0 };
  240. pDispatch->Invoke(0x5, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  241. }
  242. }
  243. delete[] pvars;
  244. }
  245. VOID Fire_ActivityDeclined()
  246. {
  247. T* pT = static_cast<T*>(this);
  248. int nConnectionIndex;
  249. int nConnections = m_vec.GetSize();
  250. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  251. {
  252. pT->Lock();
  253. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  254. pT->Unlock();
  255. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  256. if (pDispatch != NULL)
  257. {
  258. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  259. pDispatch->Invoke(0x6, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  260. }
  261. }
  262. }
  263. VOID Fire_ActivityStarted()
  264. {
  265. T* pT = static_cast<T*>(this);
  266. int nConnectionIndex;
  267. int nConnections = m_vec.GetSize();
  268. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  269. {
  270. pT->Lock();
  271. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  272. pT->Unlock();
  273. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  274. if (pDispatch != NULL)
  275. {
  276. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  277. pDispatch->Invoke(0x7, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  278. }
  279. }
  280. }
  281. VOID Fire_Timeout(LONG lTimerID)
  282. {
  283. T* pT = static_cast<T*>(this);
  284. int nConnectionIndex;
  285. CComVariant* pvars = new CComVariant[1];
  286. int nConnections = m_vec.GetSize();
  287. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  288. {
  289. pT->Lock();
  290. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  291. pT->Unlock();
  292. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  293. if (pDispatch != NULL)
  294. {
  295. pvars[0] = lTimerID;
  296. DISPPARAMS disp = { pvars, NULL, 1, 0 };
  297. pDispatch->Invoke(0x8, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  298. }
  299. }
  300. delete[] pvars;
  301. }
  302. VOID Fire_OnDblClick()
  303. {
  304. T* pT = static_cast<T*>(this);
  305. int nConnectionIndex;
  306. int nConnections = m_vec.GetSize();
  307. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  308. {
  309. pT->Lock();
  310. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  311. pT->Unlock();
  312. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  313. if (pDispatch != NULL)
  314. {
  315. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  316. pDispatch->Invoke(0x9, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  317. }
  318. }
  319. }
  320. VOID Fire_OnSysKeyUp(LONG lVirtKey, LONG lKeyData)
  321. {
  322. T* pT = static_cast<T*>(this);
  323. int nConnectionIndex;
  324. CComVariant* pvars = new CComVariant[2];
  325. int nConnections = m_vec.GetSize();
  326. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  327. {
  328. pT->Lock();
  329. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  330. pT->Unlock();
  331. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  332. if (pDispatch != NULL)
  333. {
  334. pvars[1] = lVirtKey;
  335. pvars[0] = lKeyData;
  336. DISPPARAMS disp = { pvars, NULL, 2, 0 };
  337. pDispatch->Invoke(0xa, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  338. }
  339. }
  340. delete[] pvars;
  341. }
  342. VOID Fire_OnSysKeyDown(LONG lVirtKey, LONG lKeyData)
  343. {
  344. T* pT = static_cast<T*>(this);
  345. int nConnectionIndex;
  346. CComVariant* pvars = new CComVariant[2];
  347. int nConnections = m_vec.GetSize();
  348. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  349. {
  350. pT->Lock();
  351. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  352. pT->Unlock();
  353. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  354. if (pDispatch != NULL)
  355. {
  356. pvars[1] = lVirtKey;
  357. pvars[0] = lKeyData;
  358. DISPPARAMS disp = { pvars, NULL, 2, 0 };
  359. pDispatch->Invoke(0xb, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  360. }
  361. }
  362. delete[] pvars;
  363. }
  364. VOID Fire_ReadyStateChange(LONG ReadyState)
  365. {
  366. T* pT = static_cast<T*>(this);
  367. int nConnectionIndex;
  368. CComVariant* pvars = new CComVariant[1];
  369. int nConnections = m_vec.GetSize();
  370. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  371. {
  372. pT->Lock();
  373. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  374. pT->Unlock();
  375. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  376. if (pDispatch != NULL)
  377. {
  378. pvars[0] = ReadyState;
  379. DISPPARAMS disp = { pvars, NULL, 1, 0 };
  380. pDispatch->Invoke(DISPID_READYSTATECHANGE, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  381. }
  382. }
  383. delete[] pvars;
  384. }
  385. };
  386. #endif