IHtmlPopup Error [modified]
-
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.Exception {System.UnauthorizedAccessException} 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 teh main document.
//IHTMLWindow4 parentWindow = (IHTMLWindow4)FrameDocument.parentWindow; IHTMLWindow4 parentWindow = (IHTMLWindow4)PageDocument.parentWindow; //This line will work, but if you look at the Document Property, you will see the exception IHTMLPopup popUp = (IHTMLPopup)parentWindow.createPopup( ref argIn ); //This line will throw the exception IHTMLDocument2 popupDoc = (IHTMLDocument2)popUp.document;
Any ideas? -- modified at 2:31 Saturday 8th July, 2006 -
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.Exception {System.UnauthorizedAccessException} 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 teh main document.
//IHTMLWindow4 parentWindow = (IHTMLWindow4)FrameDocument.parentWindow; IHTMLWindow4 parentWindow = (IHTMLWindow4)PageDocument.parentWindow; //This line will work, but if you look at the Document Property, you will see the exception IHTMLPopup popUp = (IHTMLPopup)parentWindow.createPopup( ref argIn ); //This line will throw the exception IHTMLDocument2 popupDoc = (IHTMLDocument2)popUp.document;
Any ideas? -- modified at 2:31 Saturday 8th July, 2006Ranjan Banerji wrote:
IHTMLDocument2 popupDoc = (IHTMLDocument2)popUp.document;
Check this link http://www.tech-archive.net/Archive/VC/microsoft.public.vc.atl/2004-03/0693.html[^] Appu.. "If you judge people, you have no time to love them."
-
Ranjan Banerji wrote:
IHTMLDocument2 popupDoc = (IHTMLDocument2)popUp.document;
Check this link http://www.tech-archive.net/Archive/VC/microsoft.public.vc.atl/2004-03/0693.html[^] Appu.. "If you judge people, you have no time to love them."
Thanks, but I am not sure that is my problem. My code works when there are no frames in the html. It fails when we have frames. Also, I can get it to work using simple javascript even in frames. Just cant get the C# code to work with frames.
-
Thanks, but I am not sure that is my problem. My code works when there are no frames in the html. It fails when we have frames. Also, I can get it to work using simple javascript even in frames. Just cant get the C# code to work with frames.
Sounds like a cross frame security issue. Steve
-
Sounds like a cross frame security issue. Steve
Yes it is. But how do I overcome it? :-) Is there a way around?