MAPIReadNext works well but MAPIReadMail doesn´t work.
Hi everybody,
As i said, MAPIReadNext function return 0 and a pointer to unread message on windows live mail, but after it, if i send a MAPIReadMail command i receive a 0 return code again, but the pointer to struct message is NULL.
Portion of my code:
MapiMessage* message ; // Created but not initialized
ULONG err=0; // Created and initialized
LPSTR rgchMsgID; // Created but not initialized
// return 0 and put 546 into rgchMsgID
ULONG uFindRet = lpfnMAPIFindNext(lhSession,0L,"","",MAPI_LONG_MSGID|MAPI_UNREAD_ONLY,0L,rgchMsgID);
err = lpfnMAPIReadMail(lhSession,0L,rgchMsgID,MAPI_BODY_AS_FILE,0,&message); // Return 0
if (message==NULL) // true, because message is NULL.
err = FAILMAIL; // Badly, Allways execute this line.
Can someone help me ?
I try everything i knew.
since now, thanks.
Re: MAPIReadNext works well but MAPIReadMail doesn´t work.
Well....of the top of my head...the third parameter is supposed to be the message id which is allocated by the caller. In your case...you actually pass in some random value.