You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
1.8 KiB
78 lines
1.8 KiB
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// CProxy_ARPCtlEvents
|
|
template <class T>
|
|
class CProxy_ARPCtlEvents : public IConnectionPointImpl<T, &DIID__ARPCtlEvents, CComDynamicUnkArray>
|
|
{
|
|
public:
|
|
//methods:
|
|
//_ARPCtlEvents : IDispatch
|
|
public:
|
|
void Fire_OnSyncDataReady()
|
|
{
|
|
T* pT = (T*)this;
|
|
pT->Lock();
|
|
IUnknown** pp = m_vec.begin();
|
|
while (pp < m_vec.end())
|
|
{
|
|
if (*pp != NULL)
|
|
{
|
|
DISPPARAMS disp = { NULL, NULL, 0, 0 };
|
|
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
|
|
pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
|
|
}
|
|
pp++;
|
|
}
|
|
pT->Unlock();
|
|
}
|
|
void Fire_OnAsyncDataReady(
|
|
long row)
|
|
{
|
|
VARIANTARG* pvars = new VARIANTARG[1];
|
|
for (int i = 0; i < 1; i++)
|
|
VariantInit(&pvars[i]);
|
|
T* pT = (T*)this;
|
|
pT->Lock();
|
|
IUnknown** pp = m_vec.begin();
|
|
while (pp < m_vec.end())
|
|
{
|
|
if (*pp != NULL)
|
|
{
|
|
pvars[0].vt = VT_I4;
|
|
pvars[0].lVal= row;
|
|
DISPPARAMS disp = { pvars, NULL, 1, 0 };
|
|
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
|
|
pDispatch->Invoke(0x2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
|
|
}
|
|
pp++;
|
|
}
|
|
pT->Unlock();
|
|
delete[] pvars;
|
|
}
|
|
void Fire_OnRowReady(
|
|
long row)
|
|
{
|
|
VARIANTARG* pvars = new VARIANTARG[1];
|
|
for (int i = 0; i < 1; i++)
|
|
VariantInit(&pvars[i]);
|
|
T* pT = (T*)this;
|
|
pT->Lock();
|
|
IUnknown** pp = m_vec.begin();
|
|
while (pp < m_vec.end())
|
|
{
|
|
if (*pp != NULL)
|
|
{
|
|
pvars[0].vt = VT_I4;
|
|
pvars[0].lVal= row;
|
|
DISPPARAMS disp = { pvars, NULL, 1, 0 };
|
|
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
|
|
pDispatch->Invoke(0x3, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
|
|
}
|
|
pp++;
|
|
}
|
|
pT->Unlock();
|
|
delete[] pvars;
|
|
}
|
|
|
|
};
|
|
|