Outlook 2007 Addin hangs if Business Contact Manager is installed

M

M_Dill

Hi folks,
We are developing an addin for Outlook 2007. The addin works perfectly if
Business Contact Manager is NOT installed. But if Business Contact Manager IS
installed, Outlook locks up whenever we try to do any contact-related
operations.

Example-
One of the features of our addin is creating a new contact from a phone
number. Our code basically does this:

ContactItem contact = app.CreateItem(OlItemType.olContactItem) as ContactItem;
contact.FullName = "Bob Smith";
contact.PrimaryTelephoneNumber = "555-5555";
contact.Save();
contact.Display(false);

This does exactly what you would expect - creates a contact named Bob Smith,
gives it a phone number of 555-555, saves it, and then displays it. The
problem happens as soon as you close the contact window. Outlook simply
hangs, and stops responding to user input. Breaking into the debugger shows
that it's not hanging in our code. Here is the call stack from the hang:

[In a sleep, wait, or join]
Microsoft.Interop.Mapi.Impl.dll!Microsoft.Interop.Mapi.GCHelper.CollectAndWaitIfNeeded() + 0x6b bytes
BCMRes.dll!Microsoft.BusinessSolutions.eCRM.Resources.MainThreadHelper.InvokerForm.WndProc(ref System.Windows.Forms.Message m) + 0x5d bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) + 0xd bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0x36 bytes
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr
hWnd, int msg = 49796, System.IntPtr wparam, System.IntPtr lparam) + 0x57
bytes
[Appdomain Transition]
[Native to Managed Transition]

Any thoughts? Are we doing something wrong? Is this a bug in Business
Contact Manager?

Thanks,
Martin Dill
 
K

Ken Slovak - [MVP - Outlook]

I don't know that there's very much BCM knowledge here. You might be better
off posting in a BCM group. Most of us here have played with BCM and
disabled it or uninstalled it a long time ago.

The alternative is to open a case with MS as to what you're seeing. Just
creating a contact and saving and displaying it should not hang Outlook in a
BCM thread, unless they;re breaking the rules and calling the OOM on a
background or other thread and not marshaling the call to their main thread,
which is a known way to get Outlook to hang very nicely.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top