unload COM addin problem

D

David Cebrian

Hi,

I have got an error when I try to unload my addin from Outlook 2003.

The error:

UnInitHandler Exception: {0} Exception HRESULT: 0x800A01A8

I get this message when the addin execute the line of code that remove one
of my CommandBarButtons
If Not (cbbEnvioSMS Is Nothing) Then

cbbEnvioSMS.Delete()

End If

I am programing in VS.NET 2003.

Anyone knows why occurs this error.

Thanks,

Jaume
 
T

Thaddaeus Parker

From the sounds of it you are attempting delete the button in the
UninitHandler AFTER the Explorer_Event_Close has already fired. The
explorer close event is where you want to get rid of all of your buttons,
etc.
Otherwise you will get the exception that you are seeing now, this is
because the COM-Addin has already "collected" the garbage leaving your
managed object dangling. When you attempt to delete using the function
Delete(), the object doesn't exist in memory any more and promptly throws an
exception. This in turn leaves some bad references in memory that causes
Outlook to remain in memory because it thinks that there is still something
out there that requires it to be resident in memory.

Regards,

Thaddaeus.
 
K

Ken Slovak - [MVP - Outlook]

If the button is created using the Temporary := True argument usually no
deleting is actually necessary for Explorer buttons. That's usually only
needed if an Inspector button is created for WordMail.
 

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