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.

78 lines
1.8 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. // CProxy_ARPCtlEvents
  3. template <class T>
  4. class CProxy_ARPCtlEvents : public IConnectionPointImpl<T, &DIID__ARPCtlEvents, CComDynamicUnkArray>
  5. {
  6. public:
  7. //methods:
  8. //_ARPCtlEvents : IDispatch
  9. public:
  10. void Fire_OnSyncDataReady()
  11. {
  12. T* pT = (T*)this;
  13. pT->Lock();
  14. IUnknown** pp = m_vec.begin();
  15. while (pp < m_vec.end())
  16. {
  17. if (*pp != NULL)
  18. {
  19. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  20. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
  21. pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  22. }
  23. pp++;
  24. }
  25. pT->Unlock();
  26. }
  27. void Fire_OnAsyncDataReady(
  28. long row)
  29. {
  30. VARIANTARG* pvars = new VARIANTARG[1];
  31. for (int i = 0; i < 1; i++)
  32. VariantInit(&pvars[i]);
  33. T* pT = (T*)this;
  34. pT->Lock();
  35. IUnknown** pp = m_vec.begin();
  36. while (pp < m_vec.end())
  37. {
  38. if (*pp != NULL)
  39. {
  40. pvars[0].vt = VT_I4;
  41. pvars[0].lVal= row;
  42. DISPPARAMS disp = { pvars, NULL, 1, 0 };
  43. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
  44. pDispatch->Invoke(0x2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  45. }
  46. pp++;
  47. }
  48. pT->Unlock();
  49. delete[] pvars;
  50. }
  51. void Fire_OnRowReady(
  52. long row)
  53. {
  54. VARIANTARG* pvars = new VARIANTARG[1];
  55. for (int i = 0; i < 1; i++)
  56. VariantInit(&pvars[i]);
  57. T* pT = (T*)this;
  58. pT->Lock();
  59. IUnknown** pp = m_vec.begin();
  60. while (pp < m_vec.end())
  61. {
  62. if (*pp != NULL)
  63. {
  64. pvars[0].vt = VT_I4;
  65. pvars[0].lVal= row;
  66. DISPPARAMS disp = { pvars, NULL, 1, 0 };
  67. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
  68. pDispatch->Invoke(0x3, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  69. }
  70. pp++;
  71. }
  72. pT->Unlock();
  73. delete[] pvars;
  74. }
  75. };