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.

39 lines
1003 B

  1. #ifndef _DGLOGSCP_H_
  2. #define _DGLOGSCP_H_
  3. template <class T>
  4. class CProxy_IDglogsComEvents : public IConnectionPointImpl<T, &DIID__IDglogsComEvents, CComDynamicUnkArray>
  5. {
  6. //Warning this class may be recreated by the wizard.
  7. public:
  8. VOID Fire_ProgressReport(BSTR * pbstrMsg, LONG nPercentDone)
  9. {
  10. T* pT = static_cast<T*>(this);
  11. int nConnectionIndex;
  12. CComVariant* pvars = new CComVariant[2];
  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. pvars[1] = (BSTR )*pbstrMsg;
  23. pvars[0] = nPercentDone;
  24. DISPPARAMS disp = { pvars, NULL, 2, 0 };
  25. pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  26. }
  27. }
  28. delete[] pvars;
  29. }
  30. };
  31. #endif