looking for decent c# addin sample

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
 
R

Randy Byrne [MVP - Outlook]

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
 
P

peter z

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
 

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