C
Cedric
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.
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.