DOM Event issues on Vista/IE8 Protected Mode

Add-in Express™ Support Service
That's what is more important than anything else

DOM Event issues on Vista/IE8 Protected Mode
 
Justin C




Posts: 6
Joined: 2009-12-15
Hello.

We are having trouble receiving DOM events from the browser while in Vista/IE8 with protected mode on.

Specifically, we can't seem to get any DocumentComplete events to be recognized. I've tried adding our site to the trusted sites list to no avail. We're using the latest build of the 2009 addin-express libraries.

Here's a snippet of what we're doing (this works perfectly outside of protected mode):

void IEModule_OnConnect(object sender, int threadId)
{
this.DocumentComplete += new AddinExpress.IE.ADXIEDocumentComplete_EventHandler(IEModule_DocumentComplete);
}

void IEModule_DocumentComplete(object pDisp, string url)
{
Utils.log("Got a doc complete!: " + url);
}

This never fires.

Any suggestions would be most helpful.
Thanks!
Posted 12 Mar, 2010 16:15:19 Top
Andrei Smolin


Add-in Express team


Posts: 18823
Joined: 2006-05-11
Hello Justin,

Justin C writes:
This never fires.


Most probably it fires all right but Protected Mode doesn't allow writing to that location. Look at http://www.add-in-express.com/creating-addins-blog/2009/06/12/internet-explorer-protected-mode-api/.


Andrei Smolin
Add-in Express Team Leader
Posted 13 Mar, 2010 06:20:06 Top
Justin C




Posts: 6
Joined: 2009-12-15
No, that Utils.log function has been thoroughly vetted and works perfectly under Vista with Protected Mode on.

It writes to c:\Users\<user>\AppData\LocalLow which has a low integrity level. We receive other log data from other sections in the code, even when we don't get logging from the events.

The Logging is *not* the problem.

Any other ideas?

Thanks!

Justin
Posted 13 Mar, 2010 09:44:09 Top
Andrei Smolin


Add-in Express team


Posts: 18823
Joined: 2006-05-11
Justin,

I've just tested the code below on Vista SP 2 + IE 8 + Protected Mode + Add-in Express for 2010 IE (build 6.1.368). The code works correctly.

public class IEModule : AddinExpress.IE.ADXIEModule
{
...
private void IEModule_DocumentComplete(object pDisp, string url)
{
    MyWindow window = new MyWindow(this.MainWindowHandle);
    System.Windows.Forms.MessageBox.Show(window, "");
}
}

class MyWindow : System.Windows.Forms.IWin32Window
{
    System.IntPtr theHandle;

    public MyWindow(System.IntPtr aHandle)
    {
        theHandle = aHandle;
    }


    #region IWin32Window Members

    IntPtr System.Windows.Forms.IWin32Window.Handle
    {
        get { return theHandle; }
    }

    #endregion
}



Andrei Smolin
Add-in Express Team Leader
Posted 15 Mar, 2010 09:35:28 Top
Salvatore G




Posts: 1
Joined: 2010-03-15
Andrei,

Does this work in Add-in Express 2009 for IE (5.2.261.0)?

I tested Vista SP2 + Protected Mode + IE8 + Add-in Express 2009 for IE (5.2.261.0) and I was unable to get the DocumentComplete event to fire.

Where are you attaching the event handler, in the constructor?

I also noticed that the IEModule_OnConnect event does not fire.

Salvatore
Posted 15 Mar, 2010 12:31:16 Top
Andrei Smolin


Add-in Express team


Posts: 18823
Joined: 2006-05-11
Hi Salvatore,

I've just tested the same code on Vista SP 2 + IE 8 + Protected Mode + Add-in Express for 2010 IE (build 5.2.261). It works for me.

        public IEModule()
        {
            InitializeComponent();
        }
 
        public IEModule(IContainer container)
        {
            container.Add(this);
 
            InitializeComponent();
        }
 
        #region Component Designer generated code
        /// <summary>
        /// Required by designer
        /// </summary>
        private System.ComponentModel.IContainer components;
 
        /// <summary>
        /// Required by designer support - do not modify
        /// the following method
        /// </summary>
        private void InitializeComponent()
        {
            // 
            // IEModule
            // 
            this.ModuleName = "MyIEAddon24";
            this.DocumentComplete += new AddinExpress.IE.ADXIEDocumentComplete_EventHandler(this.IEModule_DocumentComplete);

        }
        #endregion



Andrei Smolin
Add-in Express Team Leader
Posted 16 Mar, 2010 10:26:43 Top