Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

PRB: Cannot Insert a Style Sheet Using a Res: Protocol URL


View products that this article applies to.

This article was previously published under Q325482

↑ Back to the top


Symptoms

An ActiveX control or other code that manipulates a DHTML document can change the appearance of the document by using the IHTMLDocument2::createStyleSheet() method to add a style sheet to the document.

Before the installation of the May 15, 2002, Cumulative Patch for Internet Explorer, the style sheet can be drawn from a resource in the executable file. For example:
hr = pDoc->createStyleSheet("res://c:\\mypath\\myctl.dll/101", -1, &pStyleSheet);
				
After installing the May 15, 2002, Cumulative Patch for Internet Explorer, if the HTML document does not come from either the local computer or from a trusted site, you receive the following error message:
0x8007000E Out of memory
For more information about the May 15, 2002, cumulative patch, see the "References" section.

↑ Back to the top


Cause

This behavior is by design.

↑ Back to the top


Resolution

To dynamically add a style sheet to a page, use one of the following options: NOTE: The sites to which you are adding the style sheet have to be added to the Trusted sites zone.

↑ Back to the top


More information

To protect data on the local computer, after you install the cumulative patch mentioned in this article, Internet Explorer allows creation of a style sheet by using a file from the local computer only if the HTML page to which the style sheet is being added comes from either the local computer or from a Web site that is in the Trusted sites zone.

A resource from an executable file is considered to be from the local computer. This is true even if the executable is an ActiveX Control, an add-in to Internet Explorer, or a program that is hosting the WebBrowser Control.

↑ Back to the top


References

For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
321232� MS02-023: May 15, 2002, Cumulative Patch for Internet Explorer
For more information about scripting the styleSheet Object, visit the following MSDN Library Web site:

↑ Back to the top


Keywords: KB325482, kbprb

↑ Back to the top

Article Info
Article ID : 325482
Revision : 2
Created on : 5/10/2003
Published on : 5/10/2003
Exists online : False
Views : 383