Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. IHtmlPopup Error [modified]

IHtmlPopup Error [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++helpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ranjan Banerji
    wrote on last edited by
    #1

    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

    N 1 Reply Last reply
    0
    • R Ranjan Banerji

      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

      N Offline
      N Offline
      NiceNaidu fo
      wrote on last edited by
      #2

      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."

      R 1 Reply Last reply
      0
      • N NiceNaidu fo

        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."

        R Offline
        R Offline
        Ranjan Banerji
        wrote on last edited by
        #3

        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.

        S 1 Reply Last reply
        0
        • R Ranjan Banerji

          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.

          S Offline
          S Offline
          Stephen Hewitt
          wrote on last edited by
          #4

          Sounds like a cross frame security issue. Steve

          R 1 Reply Last reply
          0
          • S Stephen Hewitt

            Sounds like a cross frame security issue. Steve

            R Offline
            R Offline
            Ranjan Banerji
            wrote on last edited by
            #5

            Yes it is. But how do I overcome it? :-) Is there a way around?

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups