OnTabActivated not working

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

OnTabActivated not working
 
Omri Suissa




Posts: 137
Joined: 2011-10-17
Hi,
This problem is still very important to us.
We have upgraded the client to IE9 and the problem still occurs!

After several checks i'm now sure that we don't get the event OnTabActivated only on tabs that share the same appdomain (but not always).

To "prove" the problem I've printed to the output every time the addon got OnTabActivated or DocumentComplete event and capture it on video.

you can download the video from here:
http://trialupdate.diffdoof.com/DiffDoof.InstallFiles/OnTabActivated_bug.avi
(if you cant see the video please download CamStudio player from: http://camstudio.org/)

As you can see on the video the first 2 tabs sends OnTabActivated (the trace code is the first line of the event code) and the other 2 tabs don't.

If you think that IE didn't load (or removed) the addon from working on these tabs you will see that when i change a page in one of the "non-working" tabs i got the DocumentComplete event but no OnTabActivated in any case. this proves that the addon is active on all tabs.

As you can also see the 2 working tabs process ids are: 3008 and 4480. the process ids of the non working tabs are also 3008 and 4480 (you can see it in the DocumentComplete event output) but with different thread is.

This event (OnTabActivated) is the most important feature for us in addin-express, we must ensure that it will work prefect. please help us to solve it as soon as possible.

If you want to preform a live debugging session on the customer's computers i can arrange it (with the customer permission of curse).

Thank you,
Omri
Posted 05 Feb, 2012 10:58:48 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Omri,

Please try to set the LoadInMainProcess property of the add-in module to false.

Anyway, we are not able to reproduce this issue on our side. So, could you please send a newly created sample add-on project which can reproduce the issue to the support e-mail address (see readme.txt)? We will test it on our PCs.
.NET, Extended MAPI, Windows Phone & RT
Posted 06 Feb, 2012 04:37:00 Top
Sergey Grischenko


Add-in Express team


Posts: 7224
Joined: 2004-07-05
Hi Omri,

The issue may appear if the adxloader was not injected into the main process of IE9.
Please set LoadInMainProcess property to false (as suggested by Eugene) and let me know about results.
Posted 06 Feb, 2012 08:28:01 Top
Sergey Grischenko


Add-in Express team


Posts: 7224
Joined: 2004-07-05
Hi Omri,

To manage the loader injection automatically please change the default constructor of iemodule as shown below. Let me know if it helps to solve the issue in IE9.
As to IE8, I will send you the debug version of the loader today. It will help us to detect whether the loader is injected successfully or not.


        public IEModule()
        {
            InitializeComponent();

            if (!this.DesignMode)
            {
                if (GetIEVersion() >= 9)
                    this.LoadInMainProcess = false;
                else
                    this.LoadInMainProcess = true;
            }
        }

private static int GetIEVersion()
        {
            using (RegistryKey key = Registry.LocalMachine.OpenSubKey("Software\Microsoft\Internet Explorer", false))
            {
                if (key != null)
                {
                    string version = (string)key.GetValue("Version", String.Empty);
                    if (!String.IsNullOrEmpty(version))
                    {
                        string[] parts = version.Split('.');
                        if (parts.Length > 0)
                        {
                            try
                            {
                                return Convert.ToInt32(parts[0]);
                            }
                            catch
                            {
                            }
                        }
                    }
                }
            }

            return 0;
        }
Posted 06 Feb, 2012 17:18:27 Top
Sergey Grischenko


Add-in Express team


Posts: 7224
Joined: 2004-07-05
Hi Omri,

Can you please organize a remote session? I will examine the issue.
Posted 08 Feb, 2012 03:04:43 Top
Omri Suissa




Posts: 137
Joined: 2011-10-17
Hi,
Sorry for my delay, i didnt got any emails from you.
I need to set the LoadInMainProcess to false? i was under the impression that i need to set it to true in order to make the OnTabActivated to work...
I'll set it to false and check it on our client machine.
Posted 09 Feb, 2012 09:45:04 Top
Omri Suissa




Posts: 137
Joined: 2011-10-17
Sergey

Do you want me to organize a remote session when the issue happens? (as i wrote it happens sometimes)
Do you want me to try your code first? (load in main process set to false in IE9)

Omri
Posted 09 Feb, 2012 09:49:33 Top
Sergey Grischenko


Add-in Express team


Posts: 7224
Joined: 2004-07-05
Hi Omri,

LoadInMainProcess should be set to true in IE8. Please use the code above to dynamically change the property according to the IE version. I will send you the loader if 'LoadInMainProcess = false' works fine in IE9.
Posted 09 Feb, 2012 09:54:41 Top
Sergey Grischenko


Add-in Express team


Posts: 7224
Joined: 2004-07-05
Do you want me to try your code first? (load in main process set to false in IE9)

Yes, please test the code first.
Posted 09 Feb, 2012 09:56:49 Top
Omri Suissa




Posts: 137
Joined: 2011-10-17
I'll try it on the next few days with our customer and report back

Omri
Posted 09 Feb, 2012 10:02:47 Top