![]() |
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. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
#11
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 |