the IObjectWithSiteImpl

 

This class provides methods allowing an object to communicate with its site.

实现一个对象与其对应的页面进行交互的方法

 

template< class T >class ATL_NO_VTABLE IObjectWithSiteImpl : public IObjectWithSite

 

IObjectWithSiteImpl specifies two methods. The client first calls SetSite, passing the site's IUnknown pointer. This pointer is stored within the object, and can later be retrieved through a call to GetSite.

对象的调用者将页面的IUnknown指针传给对象,对象将其保存,并在需要的时候通过方法GetSite获取。

 

使用时注意:

Typically, you derive your class from IObjectWithSiteImpl when you are creating an object that is not a control. For controls, derive your class from IOleObjectImpl, which also provides a site pointer. Do not derive your class from both IObjectWithSiteImpl and IOleObjectImpl.

 

members:

methods:

SetSite

Provides the object with the site's IUnknown pointer.

STDMETHOD(SetSite)( IUnknown* pUnkSite );

 

GetSite

Queries the site for an interface pointer.

STDMETHOD(GetSite)( REFIID riid, void **ppvSite );

If the site supports this interface, the pointer is returned via ppvSite. Otherwise, ppvSite is set to NULL

 

SetChildSite

Provides the object with the site's IUnknown pointer.

 

properties:

m_spUnkSite

Manages the site's IUnknown pointer.

m_spUnkSite initially receives this pointer through a call to SetSite.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值