ICP  1
_IdaeEvents_CP.h
Go to the documentation of this file.
1 #pragma once
2 
3 template<class T>
5  public ATL::IConnectionPointImpl<T, &__uuidof(_IdaeEvents)>
6 {
7 public:
8  HRESULT Fire_OnRunStateChange(BSTR run_state)
9  {
10  HRESULT hr = S_OK;
11  T * pThis = static_cast<T *>(this);
12  int cConnections = m_vec.GetSize();
13 
14  for (int iConnection = 0; iConnection < cConnections; iConnection++)
15  {
16  pThis->Lock();
17  CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);
18  pThis->Unlock();
19 
20  IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);
21 
22  if (pConnection)
23  {
24  CComVariant avarParams[1];
25  avarParams[0] = run_state;
26  avarParams[0].vt = VT_BSTR;
27  DISPPARAMS params = { avarParams, NULL, 1, 0 };
28  hr = pConnection->Invoke(1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);
29  }
30  }
31  return hr;
32  }
33 };
34 
HRESULT Fire_OnRunStateChange(BSTR run_state)
Definition: _IdaeEvents_CP.h:8