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.

49 lines
1.3 KiB

  1. #ifndef _MSDVDOPTCP_H_
  2. #define _MSDVDOPTCP_H_
  3. template <class T>
  4. class CProxy_IDVDOpt : public IConnectionPointImpl<T, &DIID__IDVDOpt, CComDynamicUnkArray>
  5. {
  6. //Warning this class may be recreated by the wizard.
  7. public:
  8. VOID Fire_OnOpen()
  9. {
  10. T* pT = static_cast<T*>(this);
  11. int nConnectionIndex;
  12. int nConnections = m_vec.GetSize();
  13. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  14. {
  15. pT->Lock();
  16. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  17. pT->Unlock();
  18. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  19. if (pDispatch != NULL)
  20. {
  21. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  22. pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  23. }
  24. }
  25. }
  26. VOID Fire_OnClose()
  27. {
  28. T* pT = static_cast<T*>(this);
  29. int nConnectionIndex;
  30. int nConnections = m_vec.GetSize();
  31. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  32. {
  33. pT->Lock();
  34. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  35. pT->Unlock();
  36. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  37. if (pDispatch != NULL)
  38. {
  39. DISPPARAMS disp = { NULL, NULL, 0, 0 };
  40. pDispatch->Invoke(0x2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  41. }
  42. }
  43. }
  44. };
  45. #endif