webbrowser control and HTC (html component file)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?Q29kZVJhem9y?=

    webbrowser control and HTC (html component file)

    Hi,

    Is it possible to access an htc file from the windows webbrowser control? I
    am receiving the following error:

    "An error has occurred in the script on this page."
    "Error: Access is denied to [path]"
    "Url: about:blank"

    I am able to access the htc file when i run the host web page as a normal
    html file, (outside of the webbrowser control).
    But when i try to load that html string as document text in my webbrowser
    control, I receive the above error.

    I have tried the following approaches :
    - make htc reference local e.g. LI {behavior:url(' hilite.htc')}
    - make htc reference absolute e.g. LI {behavior:url(' C:\Documents and
    Settings\erika. hobbs\Desktop\H TML_components\ hilite.htc')}
    - make htc reference via a website url e.g. LI
    {behavior:url(' http://mysite/HTCResources/hilite.htc')}
    - access a resource library e.g. { behavior: url(
    "res://Resource.dll/hilite.HTC" ) }

    Below is my exact code:
    hilite.htc:

    <PUBLIC:COMPONE NT>
    <PUBLIC:ATTAC H EVENT="onmouseo ver" ONEVENT="Hilite ()" />
    <PUBLIC:ATTAC H EVENT="onmouseo ut" ONEVENT="Restor e()" />
    <SCRIPT LANGUAGE="JScri pt">
    var normalColor, normalSpacing;

    function Hilite()
    {
    // save original values
    normalColor = runtimeStyle.co lor;
    normalSpacing= runtimeStyle.le tterSpacing;

    runtimeStyle.co lor = "red";
    runtimeStyle.le tterSpacing = 2;
    }

    function Restore()
    {
    // restore original values
    runtimeStyle.co lor = normalColor;
    runtimeStyle.le tterSpacing = normalSpacing;
    }
    </SCRIPT>
    </PUBLIC:COMPONEN T>

    Host page: main.htm
    <HTML>
    <HEAD>
    <STYLE>
    LI {behavior:url(' hilite.htc')}
    </STYLE>
    </HEAD>
    <BODY>
    <P>Mouse over the two list items below to see this effect.
    <UL>
    <LI>HTML Authoring</LI>
    <LI>Dynamic HTML</LI>
    </UL>
    </BODY>
    </HTML>

    Please help.

    Many thanks.
Working...