Using Performance Counter breaks Addressbook and other message windows

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

Using Performance Counter breaks Addressbook and other message windows
Using a .NET Performance counter to monitor cpu usage breaks windows 
Nick Randolph




Posts: 14
Joined: 2007-02-13
In order to optimise the perfomance/usability of our application we have recently introduced a cpu performance counter. Using this counter prevents some of Outlook's windows from displaying properly. The easiest steps to reproduce this error are as follows:

Repro 1
- Add the following code to an Addin (perhaps in the event handler of a button):

        Dim mProcessorPerformance As New System.Diagnostics.PerformanceCounter
        mProcessorPerformance.CategoryName = "Processor"
        mProcessorPerformance.CounterName = "% Processor Time"
        mProcessorPerformance.InstanceName = "_Total"
        mProcessorPerformance.MachineName = My.Computer.Name
        MsgBox(mProcessorPerformance.NextValue)


- Run the addin and before doing anything in outlook click the button so that the perfomance counter is created and invoked.

- Attempt to open the Addressbook - results in error with message "The messaging interface has returned an unknown error. If the problem persists, restart Outlook".
- Select an item in the inbox and right-click. Instead of the usual short-cut menu, you get no response.

Repro 2

- Using the same addin as above, run the addin but don't click the button so that the performance counter is not created or invoked
- Attempt to open the addressbook (or the right-click shortcut) - this works fine
- Press the addin button to create and invoke performance counter
- Open addressbook etc - this still works fine - the issue only seems to exist if you invoke the performance counter prior to opening any of these windows.

This is a major pain point for us and your assistance resolving why this is occurring would be appreciated.

Nick
Posted 20 Feb, 2007 23:01:12 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Nick.

The issue doesn't concern the Add-in Express product and I can't give you a qualified answer. So please ask about it Microsoft support service.




P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.
Posted 21 Feb, 2007 09:59:01 Top
Nick Randolph




Posts: 14
Joined: 2007-02-13
Sergey

Interesting that you can so easily rule out that it isn't your product - I guess we were looking for you to be a little more helpful w.r.t. this issue. As much as anything you should be curious as to why Performance Counters don't work when used within Outlook and you should include it in your FAQ about the product. I will attempt to follow up with Microsoft but I doubt they will be much use as they will turn around and say that it is Add-in Express - given you probably have a strong working relationship with Microsoft I would have figured that you would have a better chance of following this up for one of your Premium customers!

Nick
Posted 21 Feb, 2007 18:22:31 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Nick.

In fact I can't figure out how this issue may relate to Add-in Express.
Let's wait for Microsoft's reply. And if it happens to be the Add-in Express issue will make necessary changes in our documentation.
On our side, I will test your code in an Add-in Express based add-in and in common Shared add-in. If I run into the same issue in the Shared add-in, then it will be clear that the problem is not in Add-in Express.
Posted 22 Feb, 2007 12:22:23 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Nick.

I get the same issue running this code from both Add-in Express and Shared add-in. I will let you know if I find any solution to solve this issue.
Posted 23 Feb, 2007 10:16:54 Top