-
Notifications
You must be signed in to change notification settings - Fork 141
Expand file tree
/
Copy path_ITableEvents_CP.H
More file actions
48 lines (39 loc) · 1.36 KB
/
_ITableEvents_CP.H
File metadata and controls
48 lines (39 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Wizard-generated connection point proxy class
// WARNING: This file may be regenerated by the wizard
#pragma once
template<class T>
class CProxy_ITableEvents :
public IConnectionPointImpl<T, &__uuidof(_ITableEvents)>
{
public:
HRESULT Fire_OnUpdateJoin(BSTR filename, BSTR fieldList, BSTR joinOptions, ITable* joinSource)
{
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[4];
avarParams[3] = filename;
avarParams[3].vt = VT_BSTR;
avarParams[2] = fieldList;
avarParams[2].vt = VT_BSTR;
avarParams[1] = joinOptions;
avarParams[1].vt = VT_BSTR;
avarParams[0] = joinSource;
avarParams[0].vt = VT_DISPATCH;
DISPPARAMS params = { avarParams, NULL, 4, 0 };
hr = pConnection->Invoke(1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, ¶ms, NULL, NULL, NULL);
}
}
//m_vec.clear(); // .NET clients are unable to remove handlers, so let's try the strategy:
// register listener before each deserialization
return hr;
}
};