View Single Post
  #2  
Old April 10th 09, 07:52 AM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Why DispEventAdvise couldn't work?

1. The object raising the events (HotInboxItems) must be alive at all times.
Make sit a global/cklass variable rather than a local one.
2. There is nothing special about the Hotmail store (which is really a PST
store).

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"ryotyankou via OfficeKB.com" u48591@uwe wrote in message
news:945fd1e51fdd8@uwe...
Q1: In OnConnection function, the follow code can work. I'm using
outlook2003.

Outlook::MAPIFolderPtr pSentFd = m_NSPtr-GetDefaultFolder(Outlook::
olFolderSentMail);
pSentFdItems = pSentFd-GetItems();
ItemsItemAddEvent:ispEventAdvise(pSentFdItems);
But following couldn't, why?
m_NSPtr-GetFolders(); then loop to search the specified folder, i'm sure
i
found the correct folder, then
if(HotPtr != NULL)//HotPtr is the correct MAPIFolderPtr for
olFolderSentMail.
{
CComPtrOutlook::_Items HotInboxItems = HotPtr-GetItems();
long ll = HotInboxItems-GetCount();
ItemsItemAddEvent:ispEventAdvise(HotInboxItems);
}
But the event could not be fired.
Q2: How could i get MailItem of the mail receive from HTTP hotmail? I
don't
know how to DispEventAdvise on hotmail's message store(I add a HTTP
account
which is MS's hotmail), i use the code above to set event on the folder of
hotmail(and i'm sure the folder is correct folder), but couldn't work. Is
there a way to get hotmail's(INTERSTOR) "Namespace" so that i can get its
folder to set the current advise?
In a word, i want to get the MailItem of HTTP mail from hotmail to
process,
is that clear?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...ddins/200904/1



Ads