CPPropPageATL.h
上传用户:lc8096
上传日期:2007-01-02
资源大小:40k
文件大小:1k
- //////////////////////////////////////////////////////////////////////////////
- // CProxy_DPropPageCtrlEvents
- template <class T>
- class CProxy_DPropPageCtrlEvents : public IConnectionPointImpl<T, &DIID__DPropPageCtrlEvents, CComDynamicUnkArray>
- {
- public:
- //methods:
- //_DPropPageCtrlEvents : IDispatch
- public:
- void Fire_ObjectFound(
- BSTR bstrObjectID)
- {
- 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_BSTR;
- pvars[0].bstrVal= bstrObjectID;
- DISPPARAMS disp = { pvars, NULL, 1, 0 };
- IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
- pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
- }
- pp++;
- }
- pT->Unlock();
- delete[] pvars;
- }
- };