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.

658 lines
18 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_IMSMFSldr : public IConnectionPointImpl<T, &DIID__IMSMFSldr, 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. VOID Fire_OnMouseDown()
  28. {
  29. T* pT = static_cast<T*>(this);
  30. int nConnectionIndex;
  31. int nConnections = m_vec.GetSize();
  32. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  33. {
  34. pT->Lock();
  35. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  36. pT->Unlock();
  37. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  38. if (pDispatch != NULL)
  39. {
  40. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  41. pDispatch->Invoke(0x2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  42. }
  43. }
  44. }
  45. VOID Fire_OnMouseUp()
  46. {
  47. T* pT = static_cast<T*>(this);
  48. int nConnectionIndex;
  49. int nConnections = m_vec.GetSize();
  50. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  51. {
  52. pT->Lock();
  53. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  54. pT->Unlock();
  55. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  56. if (pDispatch != NULL)
  57. {
  58. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  59. pDispatch->Invoke(0x3, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  60. }
  61. }
  62. }
  63. VOID Fire_OnValueChange(FLOAT flNewVal)
  64. {
  65. T* pT = static_cast<T*>(this);
  66. int nConnectionIndex;
  67. CComVariant* pvars = new CComVariant[1];
  68. int nConnections = m_vec.GetSize();
  69. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  70. {
  71. pT->Lock();
  72. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  73. pT->Unlock();
  74. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  75. if (pDispatch != NULL)
  76. {
  77. pvars[0] = flNewVal;
  78. DISPPARAMS disp = { pvars, NULL, 1, 0 };
  79. pDispatch->Invoke(0x4, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  80. }
  81. }
  82. delete[] pvars;
  83. }
  84. };
  85. template <class T>
  86. class CProxy_IMSMFText : public IConnectionPointImpl<T, &DIID__IMSMFText, CComDynamicUnkArray>
  87. {
  88. //Warning this class may be recreated by the wizard.
  89. public:
  90. VOID Fire_OnClick()
  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(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  105. }
  106. }
  107. }
  108. VOID Fire_OnMouseDown()
  109. {
  110. T* pT = static_cast<T*>(this);
  111. int nConnectionIndex;
  112. int nConnections = m_vec.GetSize();
  113. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  114. {
  115. pT->Lock();
  116. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  117. pT->Unlock();
  118. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  119. if (pDispatch != NULL)
  120. {
  121. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  122. pDispatch->Invoke(0x2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  123. }
  124. }
  125. }
  126. VOID Fire_OnMouseUp()
  127. {
  128. T* pT = static_cast<T*>(this);
  129. int nConnectionIndex;
  130. int nConnections = m_vec.GetSize();
  131. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  132. {
  133. pT->Lock();
  134. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  135. pT->Unlock();
  136. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  137. if (pDispatch != NULL)
  138. {
  139. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  140. pDispatch->Invoke(0x3, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  141. }
  142. }
  143. }
  144. };
  145. template <class T>
  146. class CProxy_MSMFImg : public IConnectionPointImpl<T, &DIID__MSMFImg, CComDynamicUnkArray>
  147. {
  148. //Warning this class may be recreated by the wizard.
  149. public:
  150. VOID Fire_OnClick()
  151. {
  152. T* pT = static_cast<T*>(this);
  153. int nConnectionIndex;
  154. int nConnections = m_vec.GetSize();
  155. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  156. {
  157. pT->Lock();
  158. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  159. pT->Unlock();
  160. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  161. if (pDispatch != NULL)
  162. {
  163. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  164. pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  165. }
  166. }
  167. }
  168. VOID Fire_OnMouseDown()
  169. {
  170. T* pT = static_cast<T*>(this);
  171. int nConnectionIndex;
  172. int nConnections = m_vec.GetSize();
  173. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  174. {
  175. pT->Lock();
  176. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  177. pT->Unlock();
  178. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  179. if (pDispatch != NULL)
  180. {
  181. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  182. pDispatch->Invoke(0x2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  183. }
  184. }
  185. }
  186. VOID Fire_OnMouseUp()
  187. {
  188. T* pT = static_cast<T*>(this);
  189. int nConnectionIndex;
  190. int nConnections = m_vec.GetSize();
  191. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  192. {
  193. pT->Lock();
  194. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  195. pT->Unlock();
  196. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  197. if (pDispatch != NULL)
  198. {
  199. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  200. pDispatch->Invoke(0x3, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  201. }
  202. }
  203. }
  204. };
  205. template <class T>
  206. class CProxy_IMSMFBar : public IConnectionPointImpl<T, &DIID__IMSMFBar, CComDynamicUnkArray>
  207. {
  208. //Warning this class may be recreated by the wizard.
  209. public:
  210. VOID Fire_OnClick()
  211. {
  212. T* pT = static_cast<T*>(this);
  213. int nConnectionIndex;
  214. int nConnections = m_vec.GetSize();
  215. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  216. {
  217. pT->Lock();
  218. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  219. pT->Unlock();
  220. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  221. if (pDispatch != NULL)
  222. {
  223. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  224. pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  225. }
  226. }
  227. }
  228. VOID Fire_OnMouseDown()
  229. {
  230. T* pT = static_cast<T*>(this);
  231. int nConnectionIndex;
  232. int nConnections = m_vec.GetSize();
  233. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  234. {
  235. pT->Lock();
  236. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  237. pT->Unlock();
  238. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  239. if (pDispatch != NULL)
  240. {
  241. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  242. pDispatch->Invoke(0x2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  243. }
  244. }
  245. }
  246. VOID Fire_OnMouseUp()
  247. {
  248. T* pT = static_cast<T*>(this);
  249. int nConnectionIndex;
  250. int nConnections = m_vec.GetSize();
  251. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  252. {
  253. pT->Lock();
  254. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  255. pT->Unlock();
  256. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  257. if (pDispatch != NULL)
  258. {
  259. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  260. pDispatch->Invoke(0x3, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  261. }
  262. }
  263. }
  264. VOID Fire_OnResize(LONG lWidth, LONG lHeight, LONG lCode)
  265. {
  266. T* pT = static_cast<T*>(this);
  267. int nConnectionIndex;
  268. CComVariant* pvars = new CComVariant[3];
  269. int nConnections = m_vec.GetSize();
  270. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  271. {
  272. pT->Lock();
  273. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  274. pT->Unlock();
  275. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  276. if (pDispatch != NULL)
  277. {
  278. pvars[2] = lWidth;
  279. pvars[1] = lHeight;
  280. pvars[0] = lCode;
  281. DISPPARAMS disp = { pvars, NULL, 3, 0 };
  282. pDispatch->Invoke(0x10, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  283. }
  284. }
  285. delete[] pvars;
  286. }
  287. VOID Fire_OnHelp(BSTR strObjectID, BSTR strExtraInfo = ::SysAllocString(L""))
  288. {
  289. T* pT = static_cast<T*>(this);
  290. int nConnectionIndex;
  291. CComVariant* pvars = new CComVariant[2];
  292. int nConnections = m_vec.GetSize();
  293. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  294. {
  295. pT->Lock();
  296. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  297. pT->Unlock();
  298. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  299. if (pDispatch != NULL)
  300. {
  301. pvars[1] = strObjectID;
  302. pvars[0] = strExtraInfo;
  303. DISPPARAMS disp = { pvars, NULL, 2, 0 };
  304. pDispatch->Invoke(0x11, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  305. }
  306. }
  307. delete[] pvars;
  308. }
  309. VOID Fire_OnKeyUp(LONG lVirtKey, LONG lKeyData)
  310. {
  311. T* pT = static_cast<T*>(this);
  312. int nConnectionIndex;
  313. CComVariant* pvars = new CComVariant[2];
  314. int nConnections = m_vec.GetSize();
  315. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  316. {
  317. pT->Lock();
  318. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  319. pT->Unlock();
  320. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  321. if (pDispatch != NULL)
  322. {
  323. pvars[1] = lVirtKey;
  324. pvars[0] = lKeyData;
  325. DISPPARAMS disp = { pvars, NULL, 2, 0 };
  326. pDispatch->Invoke(0x12, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  327. }
  328. }
  329. delete[] pvars;
  330. }
  331. VOID Fire_OnKeyDown(LONG lVirtKey, LONG lKeyData)
  332. {
  333. T* pT = static_cast<T*>(this);
  334. int nConnectionIndex;
  335. CComVariant* pvars = new CComVariant[2];
  336. int nConnections = m_vec.GetSize();
  337. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  338. {
  339. pT->Lock();
  340. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  341. pT->Unlock();
  342. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  343. if (pDispatch != NULL)
  344. {
  345. pvars[1] = lVirtKey;
  346. pvars[0] = lKeyData;
  347. DISPPARAMS disp = { pvars, NULL, 2, 0 };
  348. pDispatch->Invoke(0x13, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  349. }
  350. }
  351. delete[] pvars;
  352. }
  353. VOID Fire_ActivityDeclined()
  354. {
  355. T* pT = static_cast<T*>(this);
  356. int nConnectionIndex;
  357. int nConnections = m_vec.GetSize();
  358. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  359. {
  360. pT->Lock();
  361. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  362. pT->Unlock();
  363. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  364. if (pDispatch != NULL)
  365. {
  366. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  367. pDispatch->Invoke(0x14, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  368. }
  369. }
  370. }
  371. VOID Fire_ActivityStarted()
  372. {
  373. T* pT = static_cast<T*>(this);
  374. int nConnectionIndex;
  375. int nConnections = m_vec.GetSize();
  376. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  377. {
  378. pT->Lock();
  379. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  380. pT->Unlock();
  381. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  382. if (pDispatch != NULL)
  383. {
  384. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  385. pDispatch->Invoke(0x15, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  386. }
  387. }
  388. }
  389. VOID Fire_Timeout(LONG lTimerID)
  390. {
  391. T* pT = static_cast<T*>(this);
  392. int nConnectionIndex;
  393. CComVariant* pvars = new CComVariant[1];
  394. int nConnections = m_vec.GetSize();
  395. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  396. {
  397. pT->Lock();
  398. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  399. pT->Unlock();
  400. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  401. if (pDispatch != NULL)
  402. {
  403. pvars[0] = lTimerID;
  404. DISPPARAMS disp = { pvars, NULL, 1, 0 };
  405. pDispatch->Invoke(0x16, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  406. }
  407. }
  408. delete[] pvars;
  409. }
  410. VOID Fire_OnDblClick()
  411. {
  412. T* pT = static_cast<T*>(this);
  413. int nConnectionIndex;
  414. int nConnections = m_vec.GetSize();
  415. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  416. {
  417. pT->Lock();
  418. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  419. pT->Unlock();
  420. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  421. if (pDispatch != NULL)
  422. {
  423. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  424. pDispatch->Invoke(0x17, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  425. }
  426. }
  427. }
  428. VOID Fire_OnSysKeyUp(LONG lVirtKey, LONG lKeyData)
  429. {
  430. T* pT = static_cast<T*>(this);
  431. int nConnectionIndex;
  432. CComVariant* pvars = new CComVariant[2];
  433. int nConnections = m_vec.GetSize();
  434. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  435. {
  436. pT->Lock();
  437. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  438. pT->Unlock();
  439. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  440. if (pDispatch != NULL)
  441. {
  442. pvars[1] = lVirtKey;
  443. pvars[0] = lKeyData;
  444. DISPPARAMS disp = { pvars, NULL, 2, 0 };
  445. pDispatch->Invoke(0x18, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  446. }
  447. }
  448. delete[] pvars;
  449. }
  450. VOID Fire_OnSysKeyDown(LONG lVirtKey, LONG lKeyData)
  451. {
  452. T* pT = static_cast<T*>(this);
  453. int nConnectionIndex;
  454. CComVariant* pvars = new CComVariant[2];
  455. int nConnections = m_vec.GetSize();
  456. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  457. {
  458. pT->Lock();
  459. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  460. pT->Unlock();
  461. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  462. if (pDispatch != NULL)
  463. {
  464. pvars[1] = lVirtKey;
  465. pvars[0] = lKeyData;
  466. DISPPARAMS disp = { pvars, NULL, 2, 0 };
  467. pDispatch->Invoke(0x19, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  468. }
  469. }
  470. delete[] pvars;
  471. }
  472. VOID Fire_OnActivate(VARIANT_BOOL bActivated)
  473. {
  474. T* pT = static_cast<T*>(this);
  475. int nConnectionIndex;
  476. CComVariant* pvars = new CComVariant[1];
  477. int nConnections = m_vec.GetSize();
  478. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  479. {
  480. pT->Lock();
  481. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  482. pT->Unlock();
  483. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  484. if (pDispatch != NULL)
  485. {
  486. pvars[0] = bActivated;
  487. DISPPARAMS disp = { pvars, NULL, 1, 0 };
  488. pDispatch->Invoke(0x1a, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  489. }
  490. }
  491. delete[] pvars;
  492. }
  493. VOID Fire_ReadyStateChange(LONG ReadyState)
  494. {
  495. T* pT = static_cast<T*>(this);
  496. int nConnectionIndex;
  497. CComVariant* pvars = new CComVariant[1];
  498. int nConnections = m_vec.GetSize();
  499. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  500. {
  501. pT->Lock();
  502. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  503. pT->Unlock();
  504. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  505. if (pDispatch != NULL)
  506. {
  507. pvars[0] = ReadyState;
  508. DISPPARAMS disp = { pvars, NULL, 1, 0 };
  509. pDispatch->Invoke(DISPID_READYSTATECHANGE, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  510. }
  511. }
  512. delete[] pvars;
  513. }
  514. };
  515. template <class T>
  516. class CProxy_IMSMFBBtn : public IConnectionPointImpl<T, &DIID__IMSMFBBtn, CComDynamicUnkArray>
  517. {
  518. //Warning this class may be recreated by the wizard.
  519. public:
  520. VOID Fire_OnClick()
  521. {
  522. T* pT = static_cast<T*>(this);
  523. int nConnectionIndex;
  524. int nConnections = m_vec.GetSize();
  525. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  526. {
  527. pT->Lock();
  528. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  529. pT->Unlock();
  530. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  531. if (pDispatch != NULL)
  532. {
  533. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  534. pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  535. }
  536. }
  537. }
  538. VOID Fire_OnMouseDown()
  539. {
  540. T* pT = static_cast<T*>(this);
  541. int nConnectionIndex;
  542. int nConnections = m_vec.GetSize();
  543. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  544. {
  545. pT->Lock();
  546. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  547. pT->Unlock();
  548. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  549. if (pDispatch != NULL)
  550. {
  551. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  552. pDispatch->Invoke(0x2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  553. }
  554. }
  555. }
  556. VOID Fire_OnMouseUp()
  557. {
  558. T* pT = static_cast<T*>(this);
  559. int nConnectionIndex;
  560. int nConnections = m_vec.GetSize();
  561. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  562. {
  563. pT->Lock();
  564. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  565. pT->Unlock();
  566. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  567. if (pDispatch != NULL)
  568. {
  569. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  570. pDispatch->Invoke(0x3, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  571. }
  572. }
  573. }
  574. VOID Fire_OnDblClick()
  575. {
  576. T* pT = static_cast<T*>(this);
  577. int nConnectionIndex;
  578. int nConnections = m_vec.GetSize();
  579. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  580. {
  581. pT->Lock();
  582. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  583. pT->Unlock();
  584. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  585. if (pDispatch != NULL)
  586. {
  587. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  588. pDispatch->Invoke(0x4, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  589. }
  590. }
  591. }
  592. };
  593. #endif