The result of run script is: The MailItem property page is shown. I have no
idea about the first paramater of GetIDsOfNames, i give it "_MailItem" which
i saw via OutlookSpy as its value, but return E_NOINTERFACE.
I had another try, if we can get the dispatch pointer, why not to use it to
QI the MailItem? This is the code i tried, but failed with return value
"E_NOINTERFACE", what's the wrong with my code?
Outlook::_NameSpacePtr NameSpacePtr = m_spApp-ActiveExplorer()-GetSession()
;
if(NameSpacePtr == NULL)
{
return;
}
Outlook::MAPIFolderPtr inboxFolderPtr = NameSpacePtr-GetDefaultFolder
(Outlook:

lFolderInbox);
if(inboxFolderPtr == NULL)
{
return;
}
IDispatch *lpDisp = NameSpacePtr-GetItemFromID(_bstr_t(EntryId), _variant_t
(inboxFolderPtr-StoreID));
if(lpDisp == NULL)
{
return;
}
HRESULT hr = S_OK;
Outlook::_MailItemPtr spMailItem;
hr = lpDisp-QueryInterface(__uuidof(Outlook::_MailItem),(void **)&spMailItem)
;
if(SUCCEEDED(hr))//always return E_NOINTERFACE
{
//do my work here
}
Dmitry Streblechenko wrote:
Can you use late binding (IDispatch::GetIDsOfNames/Invoke) to retrieve the
Class property?
What do you see if you run the following script from Outlook Spy (click
"Script Editor" button on the OutlookSpy toolbar, paste the script, click
Run)
BrowseObject(Application.ActiveExplorer.Selection (1))
I'm sorry, i typed wrong word, it is not "current" but "correct". My
purpose
[quoted text clipped - 17 lines]
the
_MailItemPtr even it is encrypted Mail item??
--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...ddins/200903/1