Question

I have a task to create IE addon. When i gathered some knowledge about it, i found that it needs interface IObjectWithSite. I went thought many sites but could not understand its actual need and working.

So i would like to know what is IObjectWithSite. How it works and why we need it for creating IE addon. Also it would be good if you provide knowledge about "What is Site?".

Was it helpful?

Solution

IObjectWithSite is a generic interface the provides an option for the application that host the object implementing the interface to supply additional host interfaces. Should an object, such as IE addon, need to request additional interfaces from the host, it can always query site COM object for additional interfaces. "Site" there is not a website, but the object that hosts the addon.

More on MSDN:

Often an object needs to communicate directly with a container site object and, in effect, manage the site object itself. Outside of IOleObject::SetClientSite, there is no generic means through which an object becomes aware of its site. IObjectWithSite provides simple objects with a simple siting mechanism (lighter than IOleObject) This interface should only be used when IOleObject is not already in use.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top