Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2007 Feb : MAPI CopyMessages

www.cryer.info
Managed Newsgroup Archive

MAPI CopyMessages

Subject:MAPI CopyMessages
Posted by:"Mark Smits" (x@x)
Date:Tue, 20 Feb 2007 17:53:50

Using MAPI I loop through messages in a mail folder and for each message
extract the attachments and then trying to move the message to an archive
folder. That last step gives
me an AV somewhere inside MAPI and I am unable to figure out what's wrong.

If someone sees something wrong in the code, please help.

            MAPIAllocateBuffer(sizeof(PENTRYLIST), @pArrEntId);
            MAPIAllocateMore(sizeof(TSBinary), pArrEntID,
Pointer(pArrEntID.lpbin));
            pArrEntId.cValues := 1;
            pArrEntID.lpbin.cb := pEntIDMessage.cb;
            pArrEntID.lpbin.lpb := pEntIDMessage.lpb;
            MAPIDiesel.CopyMessages(pArrEntID, IID_IMAPIFolder,
@MAPIArchief, Self.Handle,                                         nil,
MESSAGE_MOVE);

MAPIDiesel and MAPIArchief are opened folders and valid. pEntIDMessage is
correct as well, since I am able to extract the attachments from it.

Replies:

www.cryer.info
Managed Newsgroup Archive