Browse Source

Debug / test code for events and callbacks.

COM-121
Markus Schaber 6 years ago
parent
commit
17ac198b4b
3 changed files with 38 additions and 3 deletions
  1. +4
    -2
      CpEpEngine.cpp
  2. +31
    -0
      _IpEpEngineEvents_CP.h
  3. +3
    -1
      pEpCOMServerAdapter.idl

+ 4
- 2
CpEpEngine.cpp View File

@ -812,9 +812,11 @@ STDMETHODIMP CpEpEngine::myself(struct pEp_identity_s *ident, struct pEp_identit
return E_OUTOFMEMORY;
// DEBUG CODE - REMOVE BEFORE RELEASE!
//sync_handshake_result_s handshakeResult;
// sync_handshake_result_s handshakeResult;
//
//HRESULT res = Fire_ShowHandshake(ident, result, &handshakeResult);
// HRESULT res = Fire_ShowHandshake(ident, result, &handshakeResult);
//
// HRESULT res2 = Fire_TestEvent(15, _bstr_t( "hallo"));
PEP_STATUS status = ::myself(get_session(), _ident);


+ 31
- 0
_IpEpEngineEvents_CP.h View File

@ -5,5 +5,36 @@ class CProxy_IpEpEngineEvents :
public ATL::IConnectionPointImpl<T, &__uuidof(_IpEpEngineEvents)>
{
public:
/* Test code - remove before shipping
HRESULT Fire_TestEvent(LONG test, BSTR testtest)
{
HRESULT hr = S_OK;
T * pThis = static_cast<T *>(this);
int cConnections = m_vec.GetSize();
for (int iConnection = 0; iConnection < cConnections; iConnection++)
{
pThis->Lock();
CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);
pThis->Unlock();
IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);
if (pConnection)
{
CComVariant avarParams[2];
avarParams[1] = test;
avarParams[1].vt = VT_I4;
avarParams[0] = testtest;
avarParams[0].vt = VT_BSTR;
CComVariant varResult;
DISPPARAMS params = { avarParams, NULL, 2, 0 };
hr = pConnection->Invoke(1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, &varResult, NULL, NULL);
}
}
return hr;
}*/
};

+ 3
- 1
pEpCOMServerAdapter.idl View File

@ -302,7 +302,9 @@ library pEpCOMServerAdapterLib
{
properties:
methods:
};
// test code - remove before shipping
// [id(1)] HRESULT TestEvent([in] LONG test,[in] BSTR testtest);
};
[
uuid(EF1B073D-5058-4E0E-829E-B4D22CA21EA2)
]


Loading…
Cancel
Save