Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Add-ins for Outlook (http://www.outlookbanter.com/add-ins-outlook/)
-   -   unload COM addin problem (http://www.outlookbanter.com/add-ins-outlook/5828-unload-com-addin-problem.html)

David Cebrian February 8th 06 06:10 PM

unload COM addin problem
 
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



Thaddaeus Parker February 8th 06 06:37 PM

unload COM addin problem
 
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.
"David Cebrian" wrote in message
...
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





Ken Slovak - [MVP - Outlook] February 8th 06 08:05 PM

unload COM addin problem
 
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.

--
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


"Thaddaeus Parker" wrote in message
...
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.



David Cebrian February 9th 06 11:26 AM

unload COM addin problem
 
Thanks for all,

it's so useful.


"David Cebrian" escribió en el mensaje
...
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






All times are GMT +1. The time now is 09:28 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com