473,666 Members | 2,264 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IHTMLPopup Error - Cross Frame Security

I am building a BHO that is meant to popup a IHtmlPopup window on a
mouse over image event. All the code works fine if the image is in the
main Window.

However if the image is in a frame then I get the following error:

{"Access is denied. (Exception from HRESULT: 0x80070005
(E_ACCESSDENIED ))"} System.Exceptio n
{System.Unautho rizedAccessExce ption}

This happens when I try to create the Popup Window or access its
Document
The code below is in C#, but I think it would apply to C++ too.

I have tried getting the parentWindow from the Frame's document and
from the main document.
//IHTMLWindow4 parentWindow = (IHTMLWindow4)F rameDocument.pa rentWindow;
IHTMLWindow4 parentWindow = (IHTMLWindow4)P ageDocument.par entWindow;

//This line will work, but if you look at the Document Property, you
will see the exception
IHTMLPopup popUp = (IHTMLPopup)par entWindow.creat ePopup( ref argIn );
//This line will throw the exception
IHTMLDocument2 popupDoc = (IHTMLDocument2 )popUp.document ;
Any ideas?

Jul 8 '06 #1
2 4495
The only way to prevent this that I know of is to change the setting in
Advanced section of client browser (IE) settings. You cannot acess the
contents of a frame (IFRAME) whose source is another domain, for security
reasons.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"rb******@metac rawler.com" wrote:
I am building a BHO that is meant to popup a IHtmlPopup window on a
mouse over image event. All the code works fine if the image is in the
main Window.

However if the image is in a frame then I get the following error:

{"Access is denied. (Exception from HRESULT: 0x80070005
(E_ACCESSDENIED ))"} System.Exceptio n
{System.Unautho rizedAccessExce ption}

This happens when I try to create the Popup Window or access its
Document
The code below is in C#, but I think it would apply to C++ too.

I have tried getting the parentWindow from the Frame's document and
from the main document.
//IHTMLWindow4 parentWindow = (IHTMLWindow4)F rameDocument.pa rentWindow;
IHTMLWindow4 parentWindow = (IHTMLWindow4)P ageDocument.par entWindow;

//This line will work, but if you look at the Document Property, you
will see the exception
IHTMLPopup popUp = (IHTMLPopup)par entWindow.creat ePopup( ref argIn );
//This line will throw the exception
IHTMLDocument2 popupDoc = (IHTMLDocument2 )popUp.document ;
Any ideas?

Jul 8 '06 #2
Thanks Peter,

I guess I should clarify my question a little. I know that I am
experienceing Cross Frame security issues. What I am trying to achieve
is to popup some sort of a tooltip equivalent on a mouseover event.

I think my code is causing the cross frame security issue because I am
not using the correct windows to create the popup. In my code I said I
tried the two methods:
//IHTMLWindow4 parentWindow = (IHTMLWindow4)F rameDocument.pa rentWindow;
IHTMLWindow4 parentWindow = (IHTMLWindow4)P ageDocument.par entWindow;
OageDocument is the main Document and I can see why this would go wrong
when using Frames.

FrameDocument is the document of the Frame of the element over which
the mouse is hovering. I therefore figured that
FrameDocument.p arentWindow will return me the right window to create a
popup. Obviuosly that does not seem to be the case.

Any idea, then, as to which Window I should be using? I know the
element I am hovering over, the document of the frame and the main
document.

Peter wrote:
The only way to prevent this that I know of is to change the setting in
Advanced section of client browser (IE) settings. You cannot acess the
contents of a frame (IFRAME) whose source is another domain, for security
reasons.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"rb******@metac rawler.com" wrote:
I am building a BHO that is meant to popup a IHtmlPopup window on a
mouse over image event. All the code works fine if the image is in the
main Window.

However if the image is in a frame then I get the following error:

{"Access is denied. (Exception from HRESULT: 0x80070005
(E_ACCESSDENIED ))"} System.Exceptio n
{System.Unautho rizedAccessExce ption}

This happens when I try to create the Popup Window or access its
Document
The code below is in C#, but I think it would apply to C++ too.

I have tried getting the parentWindow from the Frame's document and
from the main document.
//IHTMLWindow4 parentWindow = (IHTMLWindow4)F rameDocument.pa rentWindow;
IHTMLWindow4 parentWindow = (IHTMLWindow4)P ageDocument.par entWindow;

//This line will work, but if you look at the Document Property, you
will see the exception
IHTMLPopup popUp = (IHTMLPopup)par entWindow.creat ePopup( ref argIn );
//This line will throw the exception
IHTMLDocument2 popupDoc = (IHTMLDocument2 )popUp.document ;
Any ideas?
Jul 9 '06 #3

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

Similar topics

6
4360
by: Charles Crume | last post by:
Hello; My index.htm page (www.charlescrumesoftware.com for those interested in looking) contains 3 frames (left = content, top right = logo, bottom right = navigation). This domain name is registered with www.mydomain.com and is stealth forwarded to www.ccthecomputerguy.com (where my *real* web site currently lives). FWIW, I do this because in the 8+ years I've been on the web, I've changed ISPs about 5 times and every change requires a...
5
4205
by: Jim Marquardson | last post by:
Hi, I've struggled with this for a while now, so I'm asking for help. I am trying to click on a link in one page, have that link open up in a new window, and set that newly opened window's ifram to a specific url. Here is the code I'm using: <html> <head>
7
3906
by: Scott M. | last post by:
How can I disable the cross-site scripting check for one particular page of a site?
3
10195
by: Vongza | last post by:
<html> <head> <title>Cross Frame Reference</title> <script language="javascript"> function showThisTitle() { alert(document.title); } function showAnotherTitle() { try { alert(anotherWorld.document.title);
9
5436
by: permanent.tourist | last post by:
I'm having a hell of a job getting this to work in Safari: the only thing I can think of is that one can't use reload() across to another frame for security reasons. Does anyone have a concrete answer or solution for this? I'm trying to do this: top.frames.location.reload(); Thanks Mark Howells www.permanenttourist.ch
4
2947
by: taoberly | last post by:
Hello, Is it possible to run an HTML file from "localhost" and bypass the various security checks in place for cross-frame scripting? For example, on a 2-frame page loaded locally: a) frame 1 includes a form that accepts the name of a web site (example: www.foo.com), which a script or perhaps a "target" attribute then loads into frame 2 b) frame 1 waits for frame 2 to load, then reads (for example)
4
5045
by: Adrian | last post by:
can someone explain the cross domain security re AJAX in IE? I have a page that calls a web service (WS) from another domain (the target browser is only IE6) and displays it's results! all works fine when the page is run from my hdd, however when run from the web I get "Access denied" due to the cross domain security (I assume). So I set the browser setting to allow cross domain but this did not seem to work, I got the same error!
2
1868
by: KZSteele | last post by:
hello - i am using VBA within a microsoft access project to automate internet explorer. what i am doing is reading data from various frames in the IE window and loading them into a table. however, this cross-frame scripting security with IE is really getting on my nerves. i can't even use VB to navigate to frames located on a different domain. the page in question uses framesets, not iframes. question: how can i DISABLE the horrid...
0
1268
by: KZSteele | last post by:
(repost/edit from html forum) hello - i am using VBA within a microsoft access project to automate internet explorer. what i am doing is reading data from various frames of my company's web site (non-intranet) and loading it into a table. however, this cross-frame scripting security with IE is getting in the way. i can't even use VB to navigate to frames located on a different domain. the website in question uses framesets, not iframes. ...
0
8355
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
8781
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8550
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
8638
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7381
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
5662
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
4193
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2769
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2006
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.