View Single Post
  #4  
Old May 2nd 07, 12:17 AM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default VSTO Com-add in prevents Outlook Notes from closing first time

I don't understand.

Why are you releasing the Inspector object? It's local to the scope of
NewInspector. I use VSTO 2005 and VSTO 2005 SE and never had to release the
Inspector passed in NewInspector. I use Inspector wrapper classes to wrap
all Inspectors other than Notes usually, but that's a different story.

What exactly is your case with MS about?

The usual wisdom regarding programming Notes is don't do it, they're brain
dead. That goes back to the Outlook 97 days and hasn't changed at all. A
Notes.Inspector object is especially deadly.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"PShah" wrote in message
oups.com...
Rowland / Ken

I have the exact same scenario as Rowland. Have a C# addin for Outlook
(using VSTO 2005 not SE) and using Outlook 2003 SP2.

Ken - In my case - there is no programming done for notes. It is more
like wiring up the inspectors_NewInspector and inside that i check if
item being opened is mail item. If it is then - all the logic but if
not then just do nothing. Notes ofcourse falls inside the else block.

Recently I opened a case with Microsoft regarding this and am
currently working with them on this issue.

It seems that this issue is a bug (not related to coding in C#). Also
with the above logic - there have been some issues with calender
items. Again as mentioned above - I dont program for calender items -
so they all fall in else block but it seems that the inspector doesnt
release the reference even though i force Garbage collection.

Code in the else block (if not mail Item)

{
Marshal.ReleaseComObject(inspector)
inspector = null;

GC.WaitForPendingFinalizers();
GC.Collect();
}

Rowland - it also seems that depending on the Outlook version you are
running - u see a flavour of this issue.
My own developement machine has Outlook version 11.8120.8122 SP2 and
when i try to click "x" multiple times on the note - it crashes
outlook and restarts.
A test machine has Outlook version 11.8120.8107 SP2 and there the
behavior is that I need to click "x" twice before it closes the note.
It doesnt crash Outlook.

On speaking to the MS representative - it seems that could be a bug in
the product (VSTO or Outlook) but they are still looking into it.

Rowland - have u also seen issues for calender items (i am assuming
that u are also working with mail items).

Regarding notes - i will update this chain if i get a fix and it
works.........

Thanks


Ads