473,800 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.
Jun 27 '08 #1
0 1844

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7991
by: Vetrivel | last post by:
Application architecture : Develop interface between two existing systems, a. Enterprise CRM system b. Web based intranet system. Environment : Intranet Server : IIS and ASP. Script : VBScript and Javascript Client : 1. IE browser. 2. VBForm embedded with WebBrowser control (MS Internet
1
2660
by: boxim | last post by:
Hi All, Just after some other opinions really.... We're writing this application that in places implements the WebBrowser control to make certain bits look nicer as well as make things quicker to develop. To write each page as an owner drawn control would take ages. The only thing that bothers me is the comminication between the browser control and the main application. We're using the mshtml.dll to hook events
3
2001
by: c j anderson, mcp | last post by:
I recently had a need to be able to highlight selected text in a web browser control (working code is posted below). Attempts to access the modified html source through the webbrowser or the mshtml COM interface (see below), however, have failed and I resorted to inserting the changes into the file by the means shown... This method is not 100% successful because the innerHTML reported by the COM object is *different* from what is...
6
11253
by: ESmith | last post by:
I'm looking to user a web browser component in VS2005. I like the functionality in the AXWebBrowser component (from ActiveX controls page) that allows me to do this: mshtml.HTMLDocument doc; doc = (mshtml.HTMLDocument)this.SecureWebBrowser.Document; mshtml.HTMLButtonElement ButtonTest =
12
6381
by: Alex Clark | last post by:
Greetings, (.NET 2.0, WinXP Pro/Server 2003, IE6 with latest service packs). I've decided to take advantage of the layout characteristics of HTML documents to simplify my printing tasks, but of course it's thrown up a whole host of new issues... I'm generating a multi page printable document in HTML from my app, and displaying it in a WebBrowser control. I've looked into using some CSS
15
5687
by: Laurent Lequenne | last post by:
Hello All, I'm currently developing a free windows Scrabble (in french :)) application that uses extensively the WebBrowser class of NET 2.0 for configuration, and data browsing. It works 100% on my machine, with the WebBrowser Class, and the Microsoft.MsHtml component. I can access all elements on the pages through the events, I can change some parts. Everything is rendered with XSLTs and changing directly the document through the ...
5
8379
by: ThisBytes5 | last post by:
I have an application that uses the web browser component in VS 2005. I know this is just a wrapper for the com component. What I need to do is control wether or not the images on the navigated pages get displayed, but I'm not sure how to do this. Any suggestions?
6
7549
by: titan.nyquist | last post by:
The WebBrowser control won't load a css file written in the same directory as the program. If I put an absolute path to it, it will load it. Thus, the current directory of the WebBrowser control isn't the current directory of the program. What is the current directory? I don't want to use an absolute path, since its contents are saved to disk, and that should always load the css file no matter where it and the css file exists. Titan
3
3175
by: =?Utf-8?B?R2F1cmF2?= | last post by:
I am using the AxSHDocVw.AxWebBrowser control (named PreviewBrowser) in my C# app to load a pdf file: PreviewBrowser.Navigate(strPDF ,ref objNull,ref objNull,ref objNull,ref objNull); These PDF files are created and stored in a temp folder. The older files from temp need to be deleted everytime prior to calling the Navigate function for the current file. But I am getting an exception when i try to delete the temp folder
0
9691
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10505
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9090
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6813
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.