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