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
 
Bill Sherman




Posts: 20
Joined: 2011-05-17
Hello. I am trying to debug using breakpoints in VS 2008. I am using Add-In Express for IE (Pro).

OS: Windows XP
IE: 7, project setup is "version neutral"
VS 2008

My breakpoints do not hit.

I am unable to use "debug"/"attach to process" because the IE process launched by VS is disabled (gray) in the list of available processes; the "Attach" button is disabled when I select it.

I have seen the other topics and notes about Office config files but I assume this does not apply to IE.

Thanks
-Bill Sherman
Posted 17 May, 2011 09:58:59 Top
Sergey Grischenko


Add-in Express team


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

You don't need to run IE from VS. You just need to run IE via a shortcut on the desktop and then attach to IE tab(s) in the 'Attach to process' dialog.
Posted 17 May, 2011 10:05:19 Top
Bill Sherman




Posts: 20
Joined: 2011-05-17
Sergey:

Thank you for the fast reply.

Your answer confuses me because both the IE guide (adxie.pdf) and the videos in the Learning Center both instruct me to set up VS to run IE automatically, using the Debug tab of the project properties. Are these wrong?

Unfortunately I am unable to test this because my add-on toolbar has stopped working and I am unable to run my app. I will try to follow up later.
Posted 17 May, 2011 10:20:12 Top
Sergey Grischenko


Add-in Express team


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

Your answer confuses me because both the IE guide (adxie.pdf) and the videos in the Learning Center both instruct me to set up VS to run IE automatically, using the Debug tab of the project properties. Are these wrong?

We removed this instruction in the latest version of documentation. The fact is that running the VS debugger via F5 in VS doesn't work correctly in IE8 and later.

Unfortunately I am unable to test this because my add-on toolbar has stopped working and I am unable to run my app. I will try to follow up later.

Just unregister the add-on and comment all the startup code. Then register the project again. Let me know if the empty add-on doesn't work.
Posted 17 May, 2011 10:57:12 Top
Bill Sherman




Posts: 20
Joined: 2011-05-17
Sergey Grischenko wrote:
Just unregister the add-on and comment all the startup code. Then register the project again. Let me know if the empty add-on doesn't work.


Sorry, which startup code do you mean? The module's InitializeComponent method, or something else?

Thanks
Posted 17 May, 2011 11:01:32 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
I meant the code run when IE starts (e.g. the code in the OnConnect event handler).
If a simple add-on doesn't work, please send the adxloader.log file.
Posted 17 May, 2011 11:28:31 Top
Bill Sherman




Posts: 20
Joined: 2011-05-17
There is no custom startup code. There is no OnConnect event handler.

The log shows no problems (every entry says Success; text pasted below).

I added an ADXIEHTMLDocEvents control to the module and added an OnClick event trapper. This works correctly because I can trap events and show a message box. The message box that confirms to me that my toolbar's ToolbarObj member is null.

In other words, adxieToolBarItem1 exists but adxieToolBarItem1.ToolbarObj is null, which suggests to me that it failed to initialize properly.

Here is my OnClick handler:


private void adxiehtmlDocEvents1_OnClick(object sender, object eventObject, AddinExpress.IE.ADXCancelEventArgs e)
{
if (adxieToolBarItem1.ToolBarObj == null)
{
MessageBox.Show("no toolbarobj");
}
}

Here is the module's InitializeComponent method (auto-generated) to verify that it should be loading the toolbar:


private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.adxieToolBarItem1 = new AddinExpress.IE.ADXIEToolBarItem(this.components);
this.adxiehtmlDocEvents1 = new AddinExpress.IE.ADXIEHTMLDocEvents(this.components);
//
// adxieToolBarItem1
//
this.adxieToolBarItem1.LoadAtStartup = true;
this.adxieToolBarItem1.MenuText = "PWR Wizard";
this.adxieToolBarItem1.Position = AddinExpress.IE.ADXIEToolBarPosition.tbpNewRow;
this.adxieToolBarItem1.ToolBarType = "AddOnTest.BillToolBar1";
//
// adxiehtmlDocEvents1
//
this.adxiehtmlDocEvents1.OnClick += new AddinExpress.IE.ADXIEHTMLEventObjectEx_EventHandler(this.adxiehtmlDocEvents1_OnClick);
//
// IEModule
//
this.ModuleName = "AddOnTest";
this.ToolBars.Add(this.adxieToolBarItem1);

}

Here is the log file text:

Add-in Express Loader Log File: 05/17/2011 12:31:45

Startup directory: D:\addontest\AddOnTest\AddOnTest\bin\Debug\
Loader version: 6.3.3054.0
IE Protected Mode: Off
Operating System: Microsoft Windows XP Professional Service Pack 3 (build 2600)
Process Owner: Administrator
Command Line: "C:\Program Files\Internet Explorer\IEXPLORE.EXE" http://hourglass.comverse.com/
Run 'As Administrator': Yes
Process Elevated: No
Integrity Level: Untrusted
UAC (User Account Control): Off
------------------------------------------------------------------------
12:31:45 1360 6028 Start.
12:31:45 1360 6028 Reading the registry key 'HKEY_CLASSES_ROOT\CLSID\{E681322E-DB9A-47DD-9363-958D04ED7B76}'
12:31:45 1360 6028 Success. The registry key 'HKEY_CLASSES_ROOT\CLSID\{E681322E-DB9A-47DD-9363-958D04ED7B76}' is closed.
12:31:45 1360 6028 Converting the '{A3A5C6A6-288F-4eee-8634-2BA9D5A28002}' CLSID from string.
12:31:45 1360 6028 Success.
12:31:45 1360 6028 Attempting to get the class object by the '{A3A5C6A6-288F-4eee-8634-2BA9D5A28002}' CLSID.
12:31:45 1360 6028 Success.
12:31:45 1360 6028 Creating a new instance of the add-on loader.
12:31:45 1360 6028 Success.
12:31:45 1360 6028 Loading the configuration from the system registry.
12:31:45 1360 6028 Getting the latest CLR version.
12:31:45 1360 6028 The latest CLR version is 'v2.0.50727'.
12:31:45 1360 6028 The configuration has been loaded successfully.
12:31:45 1360 6028 Runtime version: v2.0.50727.
12:31:45 1360 6028 Assembly name: AddOnTest, PublicKeyToken=58D0C726F6864AA7.
12:31:45 1360 6028 Class name: AddOnTest.IEModule.
12:31:45 1360 6028 Registry key: CLSID\{E681322E-DB9A-47DD-9363-958D04ED7B76}.
12:31:45 1360 6028 Attempting to create a new instance of the managed add-on class: CLR - v2.0.50727
12:31:45 1360 6028 Loading CLR: v2.0.50727.
12:31:45 1360 6028 Calling CLRCreateInstance method.
12:31:45 1360 6028 Failed.
12:31:45 1360 6028 The loader will try to use the old Framework API.
12:31:45 1360 6028 The CLR v2.0.50727 has been initialized successfully.
12:31:45 1360 6028 Creating a new domain setup.
12:31:45 1360 6028 Success.
12:31:45 1360 6028 Getting the add-in directory.
12:31:45 1360 6028 Success. The directory is 'D:\addontest\AddOnTest\AddOnTest\bin\Debug\'
12:31:45 1360 6028 The configuration file is 'D:\addontest\AddOnTest\AddOnTest\bin\Debug\AddOnTest.dll.config'
12:31:45 1360 6028 The 'shadow copy' is enabled.
12:31:45 1360 6028 Creating a new application domain.
12:31:45 1360 6028 Success.
12:31:45 1360 6028 Unwrapping the managed class.
12:31:45 1360 6028 Success.
12:31:45 1360 6028 Querying the ObjectWithSite interface.
12:31:45 1360 6028 Success.
12:31:45 1360 6028 Getting the dispid of the 'Dispose' method.
12:31:45 1360 6028 Success.
12:31:45 1360 6028 Getting the dispid of the 'InitializeModule' method.
12:31:45 1360 6028 Success.
12:31:45 1360 6028 Getting the dispid of the 'InitializeLoaderAPI' method.
12:31:45 1360 6028 Success.
12:31:45 1360 6028 The managed add-on class has been created successfully.
Posted 17 May, 2011 11:51:55 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
adxieToolBarItem1.ToolbarObj is always null if the toolbar is not loaded.
Try to enable the toolbar in the View->Toolbars menu or in the IE Add-ons manager.
Posted 17 May, 2011 11:57:55 Top
Bill Sherman




Posts: 20
Joined: 2011-05-17
Sergey Grischenko wrote:
Try to enable the toolbar in the View->Toolbars menu or in the IE Add-ons manager.


That worked. Thank you!

However, a software solution would be preferable because my customers insist that it work "automatically".

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.

If not, I will explain this to the users.
Posted 17 May, 2011 12:04:47 Top
Bill Sherman




Posts: 20
Joined: 2011-05-17
About debugging:

Now that I have the toolbar running again, I am still unable to debug with breakpoints.

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.
Posted 17 May, 2011 12:09:47 Top