Why does a COM VB Add-in program remain after uninstalling it in Outlook 2000?

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

Hello,

I have created a COM Add-in using VB 6 (add-in project). This Add-In
was then compiled into a DLL file and saved. I then created a setup
file for the program using Install Shield Express version 4. (I have
also used the Package and Deployment Wizard to create the setup but it
didn't meet my requirements.)

Everything works great except I have noticed that after uninstalling
the Add-in program that the Add-In program still remains. I used the
Add/Remove Programs in the Control Panel to remove the program and it
did remove the folder where the DLL was installed.

After uninstalling the add-in program, I then went back into Outlook
2000 and noticed my Add-in program still ran. I am not sure why.
Afterwards, after exiting Outlook 2000, I then manually unregistered
the development DLL in another folder – a folder with the development
files (believing that may be the problem). However, again after
staring up Outlook again the Add-in program still ran. I also checked
Tools | Options | Other | Advanced Options | COM Add-ins and the
Add-in program was not listed in the list of Add-ins available. This
was expected since I did uninstall the add-in.

So, what am I doing wrong? I would like to have the Add-in Program
removed completely after running the uninstall using the Add/remove
programs in the control Panel. That seems to have worked since the
installation directory was deleted; however, the program still runs
for some reason. I thought unregistering the DLL using regsvr32 <name
of dll> /u could have solved the problem.

As a side note, I logged off and then relogged back on (on Windows
2000 Start | Shut Down | Log off) . I could have also rebooted my
system. After doing this, I did notice the Add-in program did not run
as expected. So, I am guessing that after a COM Add-in is uninstalled,
that the user must reboot. Does this sound right? Again I wasn't
sure.

This last note most likely is the solution to my problem. Of course,
I would prefer not having a user to reboot after uninstalling my COM
Add-in, but I guess there is no choice to get the program out of
memory and to stop running after it is uninstalled.

One more thing. In my code, I am not exactly sure if or how to close
things out correctly i.e. setting object variable to nothing and to
close out anything else that needs to be shut down. I used the event
IDTExtensibility2_OnDisconnection that may or may not be the correct
event. There is also the event IDTExtensibility2_OnBeginShutdown but I
am not using that event – it only contains comments. That may be why
my Add-In program is still running even after Outlook is closed, but
again I am not sure.

Here is the code in my IDTExtensibility2_OnDisconnection event: (just
dereferencing object variables.)
Set moActiveExplorer = Nothing
Set moNS = Nothing
Set moOL = Nothing
Set oAppMail = Nothing
Set oAppInspector = Nothing
Set oAppInspectors = Nothing


Thanks in advance. Any help is most appreciated.
 
An uninstall operation should only be done after Outlook is closed. It
sounds like your Outlook is still in memory, check Processes using
Ctrl+Alt+Delete to see if that's so. A reboot shouldn't be necessary,
I never have to in my InstallShield packages.

On_Disconnection is a Catch 22 event. It won't fire if any Outlook
objects have been instantiated in your addin until all the objects
have been released unless the user disconnects the addin from the COM
addins manager. Not on Outlook shutdown. The trick is to call your
uninit handler from the Explorer and Inspector Close events if there
are no more Inspectors or Explorers.

See the ItemsCB COM addin sample on the Resources page at
www.microeye.com for a best practices look at how to do that and the
best way to handle the On_Connection event.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm
 
Back
Top