looking for decent c# addin sample

  • Thread starter Thread starter peter z
  • Start date Start date
P

peter z

Hi,

I'm looking for a decent C# addin sample which will illustrate proper
technique for unloading the addin when Outlook is shut down. The samples
I've seen so far are either in VB6 or they have been very simplistic C#
samples.

I need to write an addin which handles NewInspector events, does something
with the inspector and then politely (but completely) unloads itself when
the user quits the Outlook app. The attempts I've made so far refuse to go
away on shut down even though the only things I'm caching in my
IDTExtensibility2 class are the two object members the VS7.0 wizard inserts
(applicationObject and addInInstance).

I've searched and found references to explorer / inspector wrappers to
achieve this complete unloading with VB6 addins but no C# samples. Anybody
got some?

FWIW, I'm using Outlook 2000, Win2k Pro, and VS7.0. I have created the
modified version of the Interop.Outlook.dll as suggested at
http://www.microeye.com/resources/res_tech_vsnet.htm#Rebuilding. I am
receiving the ExplorerClose event for the final explorer (the main app
window) but when I then set my cached values to null, the app still remains
in memory.

Thanks for any pointers on where to look.

-Peter
 
Did you look at the sample Add-in discussed in
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnout2k2/html/odc_oladdinvbnet.asp

You can convert the VB .NET code with Option Strict On to C# code. I should
mention that during testing of managed Add-ins with C#, other developers
found that C# Add-ins did not release event-aware objects correctly in C#
with OL2000. OL2002 and C# did not present the same problem.


--
Randy Byrne, MVP - Outlook
http://www.microeye.com
Building Applications with Microsoft Outlook 2002 (MSPress)
Building Applications with Microsoft Outlook 2000 (MSPress)
Micro Eye ZipOut
http://www.microeye.com/zipout
 
Randy,

Thanks for the info. I have not seen that sample but it looks like what I
need.

Also, thanks for the heads up on the C# addins with OL2000. It's good to
have some confirmation that I may not necessarily be doing anything wrong.

-Peter
 
Back
Top