ATL to implement <OBJECT>

  • Thread starter Thread starter Arsen V.
  • Start date Start date
A

Arsen V.

Hi,

If I want the same object to be a DeskBand and to be able to instantiate
this object using the <OBJECT> tag in HTML, what interfaces do I need to
implement?

I have something like this already, but it is giving me intermittent errors.
I just want to make sure I did not leave off anything important.

Thanks,
Arsen
 
I don't get it. If you want to use it as a Deskband, you only need to
support the IObjectWithSite, IPersistStream, and IDeskBand. On the other
hand, if you want to be instantiating with the <OBJECT> tag, then you need
to implement IOleControl, IOleObject, IViewObjectEx, etc, but then you can't
use it as a Deskband.

Brian
 
Arsen V. said:
If I want the same object to be a DeskBand and to be able to
instantiate this object using the <OBJECT> tag in HTML, what
interfaces do I need to implement?

Does it have to be visible when hosted on HTML page? If not, then
IUnknown is sufficient.

You may have difficulties with IObjectWithSite implementation. In both
cases, IE will query for it and call SetSite. When hosted as a toolband,
the pointer you are given is actually IWebBrowser2. But when hosted on
an HTML page, this pointer is IOleClientSite implemented by MSHTML. May
this be the source of your problem? Make sure you degrade gracefully
when the pointer passed to SetSite does not support the interfaces you
expect.
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
 
If I want the same object to be a DeskBand and to be able to instantiate
this object using the <OBJECT> tag in HTML, what interfaces do I need to
implement?


what do you want to do in the html then? why don't you create another object
of other kind?
 
Hi,

Igor, I will check the SetSite implementation to make sure it distinguishes
between the IWebBrowser2 and other pointers. Thanks!

I want to instantiate the object with the <OBJECT> tag in order to interact
with it through certain properties. Such as setting an ID, Checking Version
Number, and setting some other properties.

The <OBJECT> does not need to be visible.

Thanks,
Arsen
 
I want to instantiate the object with the <OBJECT> tag in order to interact
with it through certain properties. Such as setting an ID, Checking Version
Number, and setting some other properties.

as setting an ID, I think it is no use. to those who owned an id, it is
assigned
in designtime. to those elements without id, it's assigned dynamically by
mshtml.

as checking version no. you can do it just using that instance sit on
toolbar

setting properties? you cando it just after your control inplaceactive.
The <OBJECT> does not need to be visible.

so what?
 
Back
Top