By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,269 Members | 1,509 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,269 IT Pros & Developers. It's quick & easy.

Accessing a HTML document in a resouce dll

P: n/a
I am currently working on a C# application that uses an axWebBrowser
control which displays HTML pages. This is being done to reuse an
existing web application which resides on a client's computer. I
have created a resource .dll linking in all of the HTML, images and
JavaScript pages in the old project. Using the
res://mydll/homepage.htm, the home page loads into the web browser
control (axWebBrowser.Navigate). This page has frameset, so when I try
to access the document frames, I get an exception Access Denied.

I am using code similar to this to access the frames:

HTMLDocument myDoc = new HTMLDocumentClass();
myDoc = (HTMLDocument) axWebBrowser1.Document;
FramesCollection c = myDoc.frames;

Object o = i;
i++;
Object c1 =null;

try
{
c1 = c.item(ref o);
}
catch(Exception ex)
{
Console.WriteLine(ex.Message)
}

Is this a way that I can dynamically change the frames depending on a
users action. I have no problem displaying the frames or using the
JavaScript when they are not in a resource dll. If there a different
technique, using the Document and JavaScript when they are contained in
a resource dll.

Thank you in advance for all of your time.

Jun 27 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
How are you packaging the documents as a resource in the dll? The way
that .NET handles resources and the way that the web browser control expects
them are different.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"thompson_38" <th*********@hotmail.com> wrote in message
news:11*********************@j72g2000cwa.googlegro ups.com...
I am currently working on a C# application that uses an axWebBrowser
control which displays HTML pages. This is being done to reuse an
existing web application which resides on a client's computer. I
have created a resource .dll linking in all of the HTML, images and
JavaScript pages in the old project. Using the
res://mydll/homepage.htm, the home page loads into the web browser
control (axWebBrowser.Navigate). This page has frameset, so when I try
to access the document frames, I get an exception Access Denied.

I am using code similar to this to access the frames:

HTMLDocument myDoc = new HTMLDocumentClass();
myDoc = (HTMLDocument) axWebBrowser1.Document;
FramesCollection c = myDoc.frames;

Object o = i;
i++;
Object c1 =null;

try
{
c1 = c.item(ref o);
}
catch(Exception ex)
{
Console.WriteLine(ex.Message)
}

Is this a way that I can dynamically change the frames depending on a
users action. I have no problem displaying the frames or using the
JavaScript when they are not in a resource dll. If there a different
technique, using the Document and JavaScript when they are contained in
a resource dll.

Thank you in advance for all of your time.

Jun 27 '06 #2

P: n/a
If I am answering your question correctly, I am building a C++ resource
library, I have added all of the HTML/JavaScript in the .rc file under
the HTML tag as follows
TIPS.HTM HTML "tips.htm"
HELP.HTML HTML "help.htm"
TIPS.JS HTML "tips.js"
STYLE.CSS HTML "style.css"

Nicholas Paldino [.NET/C# MVP] wrote:
How are you packaging the documents as a resource in the dll? The way
that .NET handles resources and the way that the web browser control expects
them are different.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"thompson_38" <th*********@hotmail.com> wrote in message
news:11*********************@j72g2000cwa.googlegro ups.com...
I am currently working on a C# application that uses an axWebBrowser
control which displays HTML pages. This is being done to reuse an
existing web application which resides on a client's computer. I
have created a resource .dll linking in all of the HTML, images and
JavaScript pages in the old project. Using the
res://mydll/homepage.htm, the home page loads into the web browser
control (axWebBrowser.Navigate). This page has frameset, so when I try
to access the document frames, I get an exception Access Denied.

I am using code similar to this to access the frames:

HTMLDocument myDoc = new HTMLDocumentClass();
myDoc = (HTMLDocument) axWebBrowser1.Document;
FramesCollection c = myDoc.frames;

Object o = i;
i++;
Object c1 =null;

try
{
c1 = c.item(ref o);
}
catch(Exception ex)
{
Console.WriteLine(ex.Message)
}

Is this a way that I can dynamically change the frames depending on a
users action. I have no problem displaying the frames or using the
JavaScript when they are not in a resource dll. If there a different
technique, using the Document and JavaScript when they are contained in
a resource dll.

Thank you in advance for all of your time.


Jun 27 '06 #3

P: n/a
I have been unsuccessful in finding information pertaining to this
subject, anyone have an idea?

thompson_38 wrote:
If I am answering your question correctly, I am building a C++ resource
library, I have added all of the HTML/JavaScript in the .rc file under
the HTML tag as follows
TIPS.HTM HTML "tips.htm"
HELP.HTML HTML "help.htm"
TIPS.JS HTML "tips.js"
STYLE.CSS HTML "style.css"

Nicholas Paldino [.NET/C# MVP] wrote:
How are you packaging the documents as a resource in the dll? The way
that .NET handles resources and the way that the web browser control expects
them are different.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"thompson_38" <th*********@hotmail.com> wrote in message
news:11*********************@j72g2000cwa.googlegro ups.com...
I am currently working on a C# application that uses an axWebBrowser
control which displays HTML pages. This is being done to reuse an
existing web application which resides on a client's computer. I
have created a resource .dll linking in all of the HTML, images and
JavaScript pages in the old project. Using the
res://mydll/homepage.htm, the home page loads into the web browser
control (axWebBrowser.Navigate). This page has frameset, so when I try
to access the document frames, I get an exception Access Denied.

I am using code similar to this to access the frames:

HTMLDocument myDoc = new HTMLDocumentClass();
myDoc = (HTMLDocument) axWebBrowser1.Document;
FramesCollection c = myDoc.frames;

Object o = i;
i++;
Object c1 =null;

try
{
c1 = c.item(ref o);
}
catch(Exception ex)
{
Console.WriteLine(ex.Message)
}

Is this a way that I can dynamically change the frames depending on a
users action. I have no problem displaying the frames or using the
JavaScript when they are not in a resource dll. If there a different
technique, using the Document and JavaScript when they are contained in
a resource dll.

Thank you in advance for all of your time.


Jun 28 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.