Article ID: 320868 - Last Review: May 11, 2006 - Revision: 5.1 SAMPLE: TreeViewWrapper.exe Provides Another Option to ImageList and Inline Data in Internet ExplorerThis article was previously published under Q320868 On This PageSUMMARY
The TreeViewWrapper.exe sample provides another option to using inline data with the ImageList control, a feature that is turned off in Q313675 Security Patch, by encapsulating both the TreeView control and the ImageList control inside a Visual Basic 6.0 ActiveX control (or UserControl object). A public method on the UserControl permits images to be fetched as a batch from an XML file that is located on the Web server. This wrapper also allows population of the TreeView from Microsoft JScript. The population of the TreeView is a nontrivial operation with a TreeView that is not encapsulated because JScript does not support optional arguments.
MORE INFORMATIONThe following file is available for download from the Microsoft Download Center: Collapse this image ![]() For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base: 119591
(http://support.microsoft.com/kb/119591/EN-US/
)
How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.
The TreeViewWrapper.exe file contains the following files:
Collapse this table
Q313675 Security Patch turns off a feature in Internet Explorer known as Inline Data, which permits base64-encoded binary data to be assigned to an ActiveX control. However, you may have written Web pages that use the TreeView control and the ImageList control as directed by the following article:
BUG: Setting TreeView1.ImageList Causes Err in Internet Explorer
In the sample, you can load the images of the ImageList control if you encode all images in base64, and then assign the string after that to the DATA attribute of the OBJECT tag of the ImageList. This procedure is the feature that is turned off by Q313675 Security Patch.184975
(http://support.microsoft.com/kb/184975/EN-US/
)
BUG: Setting TreeView1.ImageList Causes Err in Internet Explorer
You can develop a control that encapsulates both the TreeView control and the ImageList control, and then loads the ImageList from an XML-based list of Uniform Resource Locator (URL) image references. The object requires that any script that is written against the raw TreeView control must be rewritten, but the required functionality of the TreeView is preserved, while the object also adheres to the new provisions that are introduced by the security patch. Populate the ImageList from a List of URLsWhile the DATA attribute permits the ImageList to be used in a Web page, the technique is cumbersome. You can populate the control if you use URL references instead of the base64-encoded image data. TreeViewWrapperProj.exe gives this capability. The LoadImages public method takes a reference to a simple XML document of the following format:Use TreeViewWrapper in a Web PageAfter you build your control, you can host your control by using a simple object tag. Code in the onload event handler of the HTML file is used to load the ImageList from the XML file and to add nodes to the tree:Deploy TreeViewWrapper to Client MachinesThe sample page that is included in this project works on a development computer or a computer where TreeViewWrapper.ocx is manually registered by using Regsrv32.exe. To deploy the sample page to arbitrary clients, you must use the Visual Basic Package and Deployment Wizard (PDW) to create a .cab file. You can then reference that .cab file in your CODEBASE attribute of the OBJECT tag. Note that you must modify both the Images.xml file and the tv1.LoadImages(...) method to point to the appropriate file path.REFERENCESFor more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites: http://msdn.microsoft.com/ie/
(http://msdn.microsoft.com/ie/)
http://support.microsoft.com/iep (http://support.microsoft.com/iep)
Internet Packages For additional information, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
http://msdn.microsoft.com/en-us/library/aa242119.aspx (http://msdn.microsoft.com/en-us/library/aa242119.aspx) 317599
(http://support.microsoft.com/kb/317599/EN-US/
)
ActiveX Inline Data Streaming Functionality Is Disabled After You Install the Q313675 Security Patch
313675
(http://support.microsoft.com/kb/313675/EN-US/
)
MS01-058: File Vulnerability Patch for Internet Explorer 5.5 and Internet Explorer 6
| Article Translations
|
Back to the top

