home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tricks of the Windows Gam…ming Gurus (2nd Edition)
/
Disc2.iso
/
msdn_vcb
/
samples
/
vc98
/
com
/
dcom
/
drawserv
/
cpidserv.h
next >
Wrap
C/C++ Source or Header
|
1998-04-02
|
996b
|
38 lines
///////////////////////////////////////////////////////////////////////////////////
// IDrawServ : IDispatch (Dual)
template <class T>
class CProxyIDrawServ :
public IConnectionPointImpl<T, &IID_IDrawServ, CComDynamicUnkArray>
{
public:
// CProxyIDrawServ(IConnectionPointContainer* pCont) :
// CComConnectionPoint< CComDynamicArrayCONNECTDATA >(pCont, &IID_IDrawServ)
// {
// }
public:
HRESULT Draw(
long x1, long y1,
long x2, long y2,
unsigned long col)
{
T* pT = (T*)this;
pT->Lock();
HRESULT hr = S_OK;
IUnknown** pp = m_vec.begin();
IUnknown** ppEnd = m_vec.end();
while (pp < ppEnd && hr == S_OK)
{
if (*pp != NULL)
{
IDrawServ* pIDrawServ = (IDrawServ*)*pp;
hr = pIDrawServ->Draw(x1, y1, x2, y2, col);
}
pp++;
}
pT->Unlock();
return hr;
}
};