Thread: Delete MailItem
View Single Post
  #5  
Old January 24th 07, 09:58 PM posted to microsoft.public.outlook.program_addins
j
external usenet poster
 
Posts: 109
Default Delete MailItem

Thanx, great explanation.

Could u please suggest mr thr brst practise of releasing com objects in
..NET.
I develop addin for OL 2003 and using .net 2 C#. When and which objects
i should release ??

for example in newinspector event i get inspector object, after this i
perform casting to mailItem for example, and
let's say concernig to my business logic i should do nothing cause
this mailitem's named property is wrong or whatever, and i exit this
method (newinspector ) , my question is:

Do i need to release mailItem with Marshal.ReleaseComObject?? i guess
yes
and do i need to Release also inspector objec, that i get as parameter
in method?????

TNX in advance.

On Jan 24, 5:02 pm, "Ken Slovak - [MVP - Outlook]"
wrote:
If an item is deleted and you still have a reference to that item it will
point to a null object but the object still needs to be released.

--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Optionshttp://www.slovaktech.com/products.htm

"j" wrote in oglegroups.com...





Thanks for replay,


After calling to Delete() method does pointer to mailItem still
remain?, suppose i call to Delete() in mailItem
that exists in Recycle folder.


TNX.- Hide quoted text -- Show quoted text -


Ads