Every now and then my call to _MailItem::Move fails. I have no idea
why that is. I only observed that in such situations the Move
operation acts as a copy and it returns a failure status.
See below:
void MoveItem(CComPtr <Outlook::_MailItem> mi, CComPtr <MAPIFolder>
newfolder)
{
HRESULT hr;
CComPtr <IDispatch> ReturnedItem;
hr = mi->Move(newfolder, &ReturnedItem);
if( FAILED( hr ))
{
//here ReturnedItem == 0x00000000 although I can see that
the item *EXISTS* in the new folder
}
// ... more code ...
}
Although the new instance of the item exists, the old one was not
deleted. Despite this the ReturnedItem (ie. the new instance == 0)
Does anyone else have more experience with this issue? I would like to
know more about what can cause this, how to prevent this from
happening. If there is no way to do this then I suppose I only have to
mitigate the impact of this happening.
The hr contains 8004010F (MAPI_E_NOT_FOUND) if the call fails.
P.S: I tried to google it and found that Redemption in one of its
earlier versions also had similar looking bug. Don't know it this
might be related or not or if it can shed some light on what is
happening behind the scenes.
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
<tnem...@googlemail.com> wrote in message
news:be6d27b3-1f54-4b40...@n21g2000vba.googlegroups.com...
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
<tnem...@googlemail.com> wrote in message
news:4c5161b3-0c7b-46b1...@j18g2000yql.googlegroups.com...