Multiple Instances, Freezes, Older Versions

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

Multiple Instances, Freezes, Older Versions
 
Ed Swartz




Posts: 3
Joined: 2014-10-14
Hi,

I'm experiencing multiples problems. I don't know if they are related.

1) I noticed there are two instances of my BHO running at the same time. In Task Manager I see the parent IE iexplorer.exe process and two iexplorer.exe *23 processes.

I read a post in the StackOverflow.com forum which suggested using a Mutex to ensure only one instance of the BHO is running at the same time. I don't know if this is the best approach when using Add-In Express.

2) I can use my BHO for a few minutes and then the browser freezes. When I mouse click on the IE window I hear a beep and then IE doesn't do anything.

According to come posts I read the problem is handling of mouse clicks. I setup my code in iemodule.cs to handle the mouse clicks as suggested by the article. That seemed to improve the situation but then IE still freezes.

3) When I change my code, rebuild and start IE I see IE runs the previous version of my BHO and the current version of my BHO. Maybe this problem is related to problem #1. I have to restart IE 2-3 times in order to get IE to run the current version of my BHO.

I've tried unregistering my BHO, closing IE, and killing the IE parent process. None of these appear to get IE to stop using the previous version of my BHO.

Ed
Posted 14 Oct, 2014 12:45:54 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Ed,

read a post in the StackOverflow.com forum which suggested using a Mutex to ensure only one instance of the BHO is running at the same time.

It is not possible in Internet Explorer. Each tab creates a new instance of your add-on/extension.


According to come posts I read the problem is handling of mouse clicks. I setup my code in iemodule.cs to handle the mouse clicks as suggested by the article. That seemed to improve the situation but then IE still freezes.

What exactly posts do you mean? Please send a simple project that reproduces the issue. I will test it.


I've tried unregistering my BHO, closing IE, and killing the IE parent process. None of these appear to get IE to stop using the previous version of my BHO.

Probably you installed the previous version via the setup program. Please check it.
When you open the 'Manage Add-ons' dialog in IE and click on your add-on, you can check the installation path by clicking on the 'More information' link at the bottom panel of the dialog.
Posted 15 Oct, 2014 05:05:12 Top
Ed Swartz




Posts: 3
Joined: 2014-10-14
Hi Sergey,

After some experimentation I discovered that IE Protected Mode caused my problems. I disabled Protected Mode and then I was able to work through many steps in my BHO. The only exception was when I started Visual Studio. IE froze. I had to kill the IE processes and then restart IE. If I work only with IE and my BHO then it appears everything works as I expect it to - no freezing of IE.

According to Rick Strahl in this article he claims mouse clicks can cause IE to freeze. He provides a solution in this article:

http://weblog.west-wind.com/posts/2004/Apr/27/Handling-mshtml-Document-Events-without-Mouse-lockups

I implemented his solution. However, since I disabled IE protected mode I don't know if Rick's solution is working for me. I don't have time to test my BHO w/o Rick's solution.

Also, it does seem my BHO is either: 1) started twice or 2) there are two copies of my BHO running at the same time in the same tab. Since, I was able to get my BHO working for my purposes I'm not worried about this problem at this time.

Thanks for your help.

Ed
Posted 15 Oct, 2014 11:12:18 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Ed,

Please enable Protected Mode. This is the default state of Internet Explorer. BHO should work properly even if Protected Mode and Enhanced Protected Mode are enabled. To debug the bho you need to use 'Attach To Process' feature in Visual Studio, not Start Debugging (F5). If you work with IE 11, it caches new tabs in the background. So you may see that your bho is started twice or more. It is by design in IE 11. The new instance of bho may be created in the same process but it will work in a separate thread.
As to 'Mouse lockups', I am not sure that it is needed. Please send me a project that reproduces the issue with mouse clicks. I will test it.
Posted 15 Oct, 2014 11:48:39 Top
Ed Swartz




Posts: 3
Joined: 2014-10-14
I enabled Protected Mode. IE now freezes again. When I click on IE application window I hear a "ding" sound. IE doesn't respond.

I want to work on one idea at a time:

I do have IE 11. Is there a way to disable caching of new tabs. Or can I update my BHO to ensure only one version of my BHO is running at a time?

I'll try attaching the debugger as you suggested after I look at the caching and see if that clears up the problem.
Posted 15 Oct, 2014 12:50:02 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Ed,

Is there a way to disable caching of new tabs.

No. It happens in IE 11 only.

can I update my BHO to ensure only one version of my BHO is running at a time?

Please read the articles below. They will help you to understand the IE architecture.

http://www.add-in-express.com/creating-addins-blog/2008/03/14/ie-addons-toolbars-menus-programming/
http://www.add-in-express.com/creating-addins-blog/2009/06/19/internet-explorer-plugin-settings-synchronize/
Posted 16 Oct, 2014 05:23:31 Top