Microsoft KB Archive/191213

= PRB: COMP_TYPE_HTMLDOC Type Fails With AddDesktopItem =

Article ID: 191213

Article Last Modified on 5/11/2006

-

APPLIES TO


 * Microsoft Internet Explorer 4.01 Service Pack 1, when used with:
 * Microsoft Windows NT 4.0

-



This article was previously published under Q191213



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  and  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 ,  and  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.

