debugging for IE in VS 2008

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

debugging for IE in VS 2008
 
Sergey Grischenko


Add-in Express team


Posts: 7224
Joined: 2004-07-05
What exactly process did you attach the add-in to?
If you develop the toolbar for IE8 and later, you should see at least two iexplore.exe processes in the 'Attach to process' dialog. You need to attach to the processes marked as 'managed' in the Type column.
Posted 17 May, 2011 14:19:32 Top
Bill Sherman




Posts: 20
Joined: 2011-05-17
Sergey Grischenko wrote:
What exactly process did you attach the add-in to?


To the one and only instance of IE that I had running.


If you develop the toolbar for IE8 and later, you should see at least two iexplore.exe processes in the 'Attach to process' dialog. You need to attach to the processes marked as 'managed' in the Type column.


This is IE7. There is only ONE process instance. It is marked as "managed".

When I created the add-in project I chose version-neutral for the IE target version.
Posted 17 May, 2011 14:27:06 Top
Sergey Grischenko


Add-in Express team


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

I don't see any problems using F5 and the 'Debug' tab to debug add-ons in IE7.
Where did you put a breakpoint? Is it an event?
Posted 18 May, 2011 05:42:18 Top
Sergey Grischenko


Add-in Express team


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

I did not disable the toolbar using the menu or the add-ons manager, so I must assume that this will happen at random times to the end users. I would like to have some startup code or something that will fix this for the user, if possible.

What if the user wants to disable the toolbar? The startup code will enable it every time.

I tried using the "attach to process" feature. There are no errors, but the breakpoints do not hit. My toolbar button launches a pop-up form, and I put a breakpoint in the code. When I click the button, the form appears but the debugger does not stop the code at the breakpoint.

Please check in Configuration Manager if you set the 'Debug' configuration in the 'Active Solution Configuration' combo box.
Posted 18 May, 2011 05:49:58 Top
Bill Sherman




Posts: 20
Joined: 2011-05-17
Sergey Grischenko wrote:
What if the user wants to disable the toolbar? The startup code will enable it every time.


The user should not be allowed to disable the toolbar. The user will be running IE on a terminal server in order to use a custom web application, and the toolbar is a necessary component of the web application. Therefore the toolbar must always be present. The add-on will not be distributed to users' local desktops, only on the Terminal Server. Personally I think that using a Terminal Server for a web app makes no sense but this is not my decision.

Many of the users are very poor at using Windows and will never guess how to enable the toolbar, and if we tell them "you have to right click-here to enable the toolbar" they will regard this as a bug because "the software doesn't work automatically".

Personally I think the new feature I'm building should be launched from a link or button in the web application pages, and NOT from the IE toolbar. Toolbar buttons and IE menus are for features that are not specific to the page being viewed. But this is not my decision.

I know I can trap user link clicks using HTML events, so that the user could launch my feature using a button or image-link IN the web page. This makes more sense to me because it is a feature of the web application, but the owners of the web application refuse to do this. They would need only to put a new link in their page but this would take too long because of their extremely slow development cycle.

Instead, management have tasked my team (not the owners of the web app) to build this new feature using an IE toolbar.

Sergey Grischenko wrote:
Please check in Configuration Manager if you set the 'Debug' configuration in the 'Active Solution Configuration' combo box.


Yes, it is selected. I also see "Debug" in the configuration dropdown box in my VS toolbar, so I know I am running Debug config when I "run".
Posted 18 May, 2011 07:53:52 Top
Bill Sherman




Posts: 20
Joined: 2011-05-17
Sergey Grischenko wrote:
I don't see any problems using F5 and the 'Debug' tab to debug add-ons in IE7.
Where did you put a breakpoint? Is it an event?


The breakpoint is in the first line of code in the toolbar button "click" event.

I know the event is firing because the code does some other things that I see happening. But the break point is ignored.
Posted 18 May, 2011 07:55:08 Top
Sergey Grischenko


Add-in Express team


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

Have you ever installed your toolbar via the setup project? If so, please uninstall it. It may cause the issue with debugging.
Posted 18 May, 2011 08:20:47 Top
Bill Sherman




Posts: 20
Joined: 2011-05-17
Sergey Grischenko wrote:
Have you ever installed your toolbar via the setup project? If so, please uninstall it. It may cause the issue with debugging.


Sergey:

No, I have not built a setup package or done any other setup/install management.
Posted 18 May, 2011 08:22:31 Top
Sergey Grischenko


Add-in Express team


Posts: 7224
Joined: 2004-07-05
Bill, to enable the toolbar at runtime you can use ShowBrowserBar method of IE object model.

Here is the wrapper around this method:

internal void ShowBrowserBar(Guid g, bool bShow)
{
if (this.ieObj != null)
{
try
{
if (bShow)
{
this.ieObj.GetType().InvokeMember("ShowBrowserBar", BindingFlags.InvokeMethod,
null, this.ieObj, new object[] { g.ToString("B"), false, null });
}
this.ieObj.GetType().InvokeMember("ShowBrowserBar", BindingFlags.InvokeMethod,
null, this.ieObj, new object[] { g.ToString("B"), bShow, null });
}
catch
{
}
}

Also please read the following post:
http://www.add-in-express.com/forum/read.php?FID=10&TID=9048&MID=46148#message46148
Posted 18 May, 2011 08:29:02 Top
Sergey Grischenko


Add-in Express team


Posts: 7224
Joined: 2004-07-05
Please try to unregister the toolbar. Do you see it in the Add-ons Manager in IE after unregistration?
Posted 18 May, 2011 08:30:29 Top