_IEsmeReceiverComEvents_CP.h
资源名称:smpplib.zip [点击查看]
上传用户:hkcoast
上传日期:2007-01-12
资源大小:979k
文件大小:1k
源码类别:
手机短信编程
开发平台:
Visual C++
- #pragma once
- template<class T>
- class CProxy_IEsmeReceiverComEvents :
- public IConnectionPointImpl<T, &__uuidof(_IEsmeReceiverComEvents)>
- {
- public:
- HRESULT Fire_OnDeliverSM( IDeliverSMCom * dsm)
- {
- 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[1];
- avarParams[0] = dsm;
- CComVariant varResult;
- DISPPARAMS params = { avarParams, NULL, 1, 0 };
- hr = pConnection->Invoke(1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, ¶ms, &varResult, NULL, NULL);
- }
- }
- return hr;
- }
- };