CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2007

    Unhappy 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.

  2. #2
    Join Date
    May 2000
    KY, USA

    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 actually pass in some random value.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width