![]() |
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 |
#1
|
|||
|
|||
![]()
Hello all,
As I've already read about this issue, I know the title of my post may have made you grin. My add-in needs to track the activity of some folders. I know that under certain conditions, the Items events may not fire. This is why, in order to avoid my objects references getting eaten by the GC, I have: - recursively created a tree of objects named QFolderWatcher, whose purpose is to watch the activity of the outlook folders tree (or at least part of the tree) - included 2 variables in this class, named MyFolders and MyItems. When creating a new QFolderWatcher, I save in a private variable the MAPIFolder, and then put (VB): MyFolders = Folder.Folders MyItems = Folder.Items Both variables are declared WithEvents, and all my objects have cross references with: - QFolderWatcher.SubFolders =list(of QFolderWatcher) : the list of QFolderWatchers watching the current folder's subfolders - QFolderWatcher.Parent : the FolderWatcher that watches the MAPIFolder's parent folder. The strange thing is that both variables MyFolders and MyItems are created and initialized at the same place, and my application receives events from the folders, but nothing about its items. |
Ads |
#2
|
|||
|
|||
![]()
As you know, almost all the time this happens it's due to out of scope
objects or objects that have been garbage collected. No exceptions in your code and if you step the code everything is instantiated and not Nothing? Have you tried simplifying the code to handle only one folder and one Items collection to make sure that works with how you're doing things? What version of Outlook? What version of the PIA are you referencing? What version of VS? What code are you using, show a small piece that someone can look at for your instantiations and for your adding event handlers and your event handler signatures. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Cedric" wrote in message ... Hello all, As I've already read about this issue, I know the title of my post may have made you grin. My add-in needs to track the activity of some folders. I know that under certain conditions, the Items events may not fire. This is why, in order to avoid my objects references getting eaten by the GC, I have: - recursively created a tree of objects named QFolderWatcher, whose purpose is to watch the activity of the outlook folders tree (or at least part of the tree) - included 2 variables in this class, named MyFolders and MyItems. When creating a new QFolderWatcher, I save in a private variable the MAPIFolder, and then put (VB): MyFolders = Folder.Folders MyItems = Folder.Items Both variables are declared WithEvents, and all my objects have cross references with: - QFolderWatcher.SubFolders =list(of QFolderWatcher) : the list of QFolderWatchers watching the current folder's subfolders - QFolderWatcher.Parent : the FolderWatcher that watches the MAPIFolder's parent folder. The strange thing is that both variables MyFolders and MyItems are created and initialized at the same place, and my application receives events from the folders, but nothing about its items. |
#3
|
|||
|
|||
![]()
Hi Ken,
thanks for your help and sorry for bothering : the issue is actually closed. A condition that never happened to be true, plus a mess in version management. Events are fired correctly now. Thanks anyway! Ced |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Registering events on calendar items on startup | Manish | Add-ins for Outlook | 4 | May 12th 08 07:31 PM |
How do I un-delete calendar events from my deleted items | RRGamache | Outlook - Calandaring | 1 | January 28th 08 07:47 PM |
notes converted to 24hr events - multi day items discconnected | Bill | Outlook - Calandaring | 5 | January 3rd 08 10:35 PM |
Explorer' Close event not fired | j | Add-ins for Outlook | 9 | April 2nd 07 02:24 PM |
Hooking events for new items in a mail folder | mika | Outlook - Using Forms | 0 | February 17th 06 08:58 AM |