_IpEpEngineEvents_CP.h
author Krista Grothoff <krista@pep-project.org>
Thu, 08 Sep 2016 11:25:22 +0200
branchCOM-28
changeset 160 9b97e91f4ad0
parent 85 8939007c795b
permissions -rw-r--r--
Closed branch COM-28
     1 #pragma once
     2 
     3 template<class T>
     4 class CProxy_IpEpEngineEvents :
     5 	public ATL::IConnectionPointImpl<T, &__uuidof(_IpEpEngineEvents)>
     6 {
     7 public:
     8 
     9 	/* Test code - remove before shipping 
    10 	HRESULT Fire_TestEvent(LONG test, BSTR testtest)
    11 	{
    12 		HRESULT hr = S_OK;
    13 		T * pThis = static_cast<T *>(this);
    14 		int cConnections = m_vec.GetSize();
    15 
    16 		for (int iConnection = 0; iConnection < cConnections; iConnection++)
    17 		{
    18 			pThis->Lock();
    19 			CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);
    20 			pThis->Unlock();
    21 
    22 			IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);
    23 
    24 			if (pConnection)
    25 			{
    26 				CComVariant avarParams[2];
    27 				avarParams[1] = test;
    28 				avarParams[1].vt = VT_I4;
    29 				avarParams[0] = testtest;
    30 				avarParams[0].vt = VT_BSTR;
    31 				CComVariant varResult;
    32 
    33 				DISPPARAMS params = { avarParams, NULL, 2, 0 };
    34 				hr = pConnection->Invoke(1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, &varResult, NULL, NULL);
    35 			}
    36 		}
    37 		return hr;
    38 	}*/
    39 };
    40