PRB: COMP_TYPE_HTMLDOC Type Fails With AddDesktopItem

ID: Q191213


The information in this article applies to:
  • Microsoft Internet Explorer (Programming) versions 4.01 SP1, 5.0, used with:
    • Microsoft Windows NT


SYMPTOMS

Calling IActiveDesktop::AddDesktopItem with a COMPONENT structure containing the component type COMP_TYPE_HTMLDOC causes the added component to appear in the Active Desktop component Preview property sheet page, but not on the Desktop itself.


RESOLUTION

Instead of the COMP_TYPE_HTMLDOC type, specify the component type COMP_TYPE_WEBSITE in the COMPONENT structure. Using the IActiveDesktop::AddURL method with the COMP_TYPE_HTMLDOC flag instead of IActiveDesktop::AddDesktopItem also works.


STATUS

This behavior is by design.


MORE INFORMATION

The component types defined for the IActiveDesktop COMPONENT structure indicates the type of the component to the Active Deskttop. When adding an HTML document to the Active Desktop it is natural to assume that COMP_TYPE_HTMLDOC is the correct value to use in the COMPONENT structure's iComponentType element. If COMP_TYPE_HTMLDOC is used the HTML document will not appear as a component of the Active Desktop although it will appear in the ActiveDesktop property sheet preview pane (right-click the desktop and choose Active Desktop followed by Customize my Desktop).

The COMP_TYPE_HTMLDOC component type is designed to specify an HTML document that includes only the HTML that would normally go between the <BODY> and </BODY> tags. The specified HTML file is merged with the Desktop HTML generated by the Active Desktop. At present, even if the COMP_TYPE_HTMLDOC type is used as designed, the ::AddDesktopItem method will fail as described above and no component will appear on the Desktop.

The component type COMP_TYPE_WEBSITE is designed to specify a complete HTML file, including <HTML>, <HEAD> and <BODY> tags, or a fully qualified URL to a Web site. This is the component type that is most commonly desired when ::AddDesktopItem is called with COMP_TYPE_HTMLDOC. Specifying COMP_TYPE_WEBSITE instead of COMP_TYPE_HTMLDOC with a call to the ::AddDesktopItem method will operate as expected and the component will appear both in the preview pane and on the Desktop.

At present, specifying COMP_TYPE_HTMLDOC with ::AddDesktopItem will do no more then make it appear that the component has been added in the preview pane.


REFERENCES

For more information, please see the MSDN Web Workshop:

http://msdn.microsoft.com/workshop/default.asp

Additional query words:

Keywords : kbActiveDesktop kbIE401 kbIE401sp1 kbIE500
Version :
Platform :
Issue type : kbprb


Last Reviewed: May 7, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.