p≡p COM server adapter
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.

40 lines
1.0 KiB

7 years ago
7 years ago
7 years ago
  1. #pragma once
  2. template<class T>
  3. class CProxy_IpEpEngineEvents :
  4. public ATL::IConnectionPointImpl<T, &__uuidof(_IpEpEngineEvents)>
  5. {
  6. public:
  7. /* Test code - remove before shipping
  8. HRESULT Fire_TestEvent(LONG test, BSTR testtest)
  9. {
  10. HRESULT hr = S_OK;
  11. T * pThis = static_cast<T *>(this);
  12. int cConnections = m_vec.GetSize();
  13. for (int iConnection = 0; iConnection < cConnections; iConnection++)
  14. {
  15. pThis->Lock();
  16. CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);
  17. pThis->Unlock();
  18. IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);
  19. if (pConnection)
  20. {
  21. CComVariant avarParams[2];
  22. avarParams[1] = test;
  23. avarParams[1].vt = VT_I4;
  24. avarParams[0] = testtest;
  25. avarParams[0].vt = VT_BSTR;
  26. CComVariant varResult;
  27. DISPPARAMS params = { avarParams, NULL, 2, 0 };
  28. hr = pConnection->Invoke(1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, &varResult, NULL, NULL);
  29. }
  30. }
  31. return hr;
  32. }*/
  33. };