A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Deleted Items



 
 
Thread Tools Search this Thread Display Modes
  #11  
Old March 8th 06, 05:03 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Deleted Items

All that means is that something is holding a reference to the original item
and it's taking a while for it to go away. That's classic behavior for
something that's finally getting hit by the garbage collector and not being
fully released until then. You're going to have to put your detective's hat
on to find what that is.

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


"Rog" wrote in message ...
Yes it seems if I do wait some period of time after deleting an item from
the contacts folder it will be picked up that it has moved into the
Deleted Items Folder.
What is odd too is, I used OutlookSpy to look at PR_PARENT_ENTRYID and it
shows the deleted items folder enntry, but if I use the same in my code:
safeMailitem.get_Fields(235471106); it will return the entryid of the
Contacts folder.


Ads
  #12  
Old March 8th 06, 06:40 PM posted to microsoft.public.outlook.program_addins
Rog
external usenet poster
 
Posts: 62
Default Deleted Items

thanks Ken, do you have any suggestions or tools that may help me to
figure that out?

Ken Slovak - [MVP - Outlook] wrote:
All that means is that something is holding a reference to the original
item and it's taking a while for it to go away. That's classic behavior
for something that's finally getting hit by the garbage collector and
not being fully released until then. You're going to have to put your
detective's hat on to find what that is.

  #13  
Old March 9th 06, 03:27 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Deleted Items

No, not really. It's a matter of looking over each line of your code with a
microscope and checking for creation of implicit variables (from using
compound dot operators instead of explicitly declared variables for each dot
operator), making sure everything is explicitly released instead of relying
on things to go out of scope and other best practices.

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


"Rog" wrote in message ...
thanks Ken, do you have any suggestions or tools that may help me to
figure that out?


  #14  
Old March 9th 06, 05:20 PM posted to microsoft.public.outlook.program_addins
Rog
external usenet poster
 
Posts: 62
Default Deleted Items

OK so for example if I get a list of contacts like
GetNamespace("MAPI").GetDefaultFolder(OlDefaultFol ders.olFolderContacts).Items;
and I use it, do I need to release it when I am done with these items?
Also if I say:
object item = GetFolderFromId(entry, store);
do I need to release this item and garbage collect everytime when I am
done with it?
rog

Ken Slovak - [MVP - Outlook] wrote:
No, not really. It's a matter of looking over each line of your code
with a microscope and checking for creation of implicit variables (from
using compound dot operators instead of explicitly declared variables
for each dot operator), making sure everything is explicitly released
instead of relying on things to go out of scope and other best practices.

  #15  
Old March 9th 06, 05:21 PM posted to microsoft.public.outlook.program_addins
Rog
external usenet poster
 
Posts: 62
Default Deleted Items

Also do you have a place to go where I can learn these best practices?
Rog

Ken Slovak - [MVP - Outlook] wrote:
No, not really. It's a matter of looking over each line of your code
with a microscope and checking for creation of implicit variables (from
using compound dot operators instead of explicitly declared variables
for each dot operator), making sure everything is explicitly released
instead of relying on things to go out of scope and other best practices.

  #16  
Old March 9th 06, 06:16 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Deleted Items

I would break that up so no implicit object variables are created. In VB 6
syntax:

Dim oNS As Outlook.NameSpace
Dim oFolder As Outlook.MAPIFolder
Dim colItems As Outlook.Items

Set oNS = oOL.GetNameSpace("MAPI")
Set oFolder = oNS.GetDefaultFolder(olFolderContacts)
Set colItems = oFolder.Items

I would explicitly release objects as soon as they are no longer needed. I
would minimize the calls to the garbage collector until they are needed,
perhaps in the shutdown code and whenever you need to ensure that no cached
object references are being maintained.

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


"Rog" wrote in message ...
OK so for example if I get a list of contacts like
GetNamespace("MAPI").GetDefaultFolder(OlDefaultFol ders.olFolderContacts).Items;
and I use it, do I need to release it when I am done with these items?
Also if I say:
object item = GetFolderFromId(entry, store);
do I need to release this item and garbage collect everytime when I am
done with it?
rog


  #17  
Old March 9th 06, 06:16 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Deleted Items

Look at the information at
http://www.microeye.com/resources/res_outlookvsnet.htm

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


"Rog" wrote in message ...
Also do you have a place to go where I can learn these best practices?
Rog

Ken Slovak - [MVP - Outlook] wrote:
No, not really. It's a matter of looking over each line of your code with
a microscope and checking for creation of implicit variables (from using
compound dot operators instead of explicitly declared variables for each
dot operator), making sure everything is explicitly released instead of
relying on things to go out of scope and other best practices.


  #18  
Old March 10th 06, 09:58 PM posted to microsoft.public.outlook.program_addins
Rog
external usenet poster
 
Posts: 62
Default Deleted Items

As always thank you Ken.
I am wondering I tried adding:
try
{
while
(System.Runtime.InteropServices.Marshal.ReleaseCom Object(contactItem) 0);
contactItem = null;
}
catch(System.Exception ex)
{
GlobalConstants.Log(log, "Error", "ReleasingComObjects", ex);
}

but sometimes it seems that while I am trying to do my processing I lose
reference to my object even though it was created after this.
Any ideas?
Thanks,
Rog
Ken Slovak - [MVP - Outlook] wrote:
Look at the information at
http://www.microeye.com/resources/res_outlookvsnet.htm

  #19  
Old March 13th 06, 04:47 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Deleted Items

I have no idea.

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


"Rog" wrote in message
...
As always thank you Ken.
I am wondering I tried adding:
try
{
while
(System.Runtime.InteropServices.Marshal.ReleaseCom Object(contactItem)
0);
contactItem = null;
}
catch(System.Exception ex)
{
GlobalConstants.Log(log, "Error", "ReleasingComObjects", ex);
}

but sometimes it seems that while I am trying to do my processing I lose
reference to my object even though it was created after this.
Any ideas?
Thanks,
Rog


  #20  
Old March 16th 06, 03:50 PM posted to microsoft.public.outlook.program_addins
Rog
external usenet poster
 
Posts: 62
Default Deleted Items

Just an update:
Thanks so Ken and Dmitry's guidance I have solved the deleted items problem
It definately was items being held in memory.
The point where I found where my items were being held in memory was
when I use the InspectorWrapper. On close of the inspector I was not
releasing the items from memory.
Thanks guys.


Ken Slovak - [MVP - Outlook] wrote:
I have no idea.


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleted email not going to Deleted Items folder techie_comps Outlook - General Queries 1 February 27th 06 05:59 PM
2 different Deleted Items folders?? Al Clark Outlook - General Queries 1 February 21st 06 10:49 AM
Inbox, Sent Items & Outbox in Deleted Items in Outlook 2003 & OWA with Exchange splounx Outlook - General Queries 1 February 17th 06 03:22 AM
Recover Deleted Items Paul Johnson Outlook - General Queries 1 February 9th 06 04:10 PM
how to clear deleted items? [email protected] Outlook - General Queries 3 January 16th 06 03:36 PM


All times are GMT +1. The time now is 12:35 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.