Hi,

I write a program in C++ for pocket pc 2002.

I would like to integrate with MS Pocket Outlook using MAPI.

The problem is, that I can't retrieve message recipients for a message,
stored in
OUTBOX directory.

I can list all messages in this directory and retrieve most of their data,
e.g.
subject, message delivery time and so on.

How can I get message recipients? I tried with "Recipient Tables", but
when I use
SetColumns function I always receive the following error: "Not
implemented".

There is some source code:

SizedSPropTagArray(3, Columns) = {3,{PR_DISPLAY_NAME,
PR_RECIPIENT_TYPE,
PR_ROWID}};

hrResult = pMessage->GetRecipientTable(
MAPI_UNICODE,
&pMsgRecipientsTable
);


if( FAILED( hrResult ) )
goto EXIT;

hrResult = pMsgRecipientsTable->SetColumns( (LPSPropTagArray)&Columns,
0 );

//////////////////////////////

The result is "Not Implemented"

//////////////////////////////

if( FAILED( hrResult ) )
goto EXIT;


while( !FAILED( hrResult = pMsgRecipientsTable->QueryRows( 1, 0,
&pRows ) ) )
{
.................................
}

What exactly should be done in order to retrieve message recipients?

Regards,
Iliyan Peychev

Re: MAPI retrieve recipients of a message by Nav

Nav
Wed Jun 16 14:28:34 CDT 2004

Try QueryRows function on pMsgRecipientsTable, and then look for
PR_EMAIL_ADDRESS property in the rows returned...

--
Nav Mehta [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.

"Iliyan Peychev" <Iliyan.Peychev@iss-bg.com> wrote in message
news:opr9owewnzmizc53@chronos...
> Hi,
>
> I write a program in C++ for pocket pc 2002.
>
> I would like to integrate with MS Pocket Outlook using MAPI.
>
> The problem is, that I can't retrieve message recipients for a message,
> stored in
> OUTBOX directory.
>
> I can list all messages in this directory and retrieve most of their data,
> e.g.
> subject, message delivery time and so on.
>
> How can I get message recipients? I tried with "Recipient Tables", but
> when I use
> SetColumns function I always receive the following error: "Not
> implemented".
>
> There is some source code:
>
> SizedSPropTagArray(3, Columns) = {3,{PR_DISPLAY_NAME,
> PR_RECIPIENT_TYPE,
> PR_ROWID}};
>
> hrResult = pMessage->GetRecipientTable(
> MAPI_UNICODE,
> &pMsgRecipientsTable
> );
>
>
> if( FAILED( hrResult ) )
> goto EXIT;
>
> hrResult = pMsgRecipientsTable->SetColumns(
(LPSPropTagArray)&Columns,
> 0 );
>
> //////////////////////////////
>
> The result is "Not Implemented"
>
> //////////////////////////////
>
> if( FAILED( hrResult ) )
> goto EXIT;
>
>
> while( !FAILED( hrResult = pMsgRecipientsTable->QueryRows( 1, 0,
> &pRows ) ) )
> {
> .................................
> }
>
> What exactly should be done in order to retrieve message recipients?
>
> Regards,
> Iliyan Peychev



Re: MAPI retrieve recipients of a message by Iliyan

Iliyan
Thu Jun 17 02:52:19 CDT 2004

Hi,

What did you mean, I shouldn't use "SetColumns" function?

QueryRows function should be used after SetColums, doesn't it?

How can I indicate "PR_EMAIL_ADDRESS" without using "SetColumns"? Look at
the following example:

--------------------------------------------------------------------------------

enum {
ePR_EMAIL_ADDRESS,
NUM_COLS};

static SizedSPropTagArray(NUM_COLS, Columns) =
{
NUM_COLS,
PR_EMAIL_ADDRESS
};

LPSPropValue lpProp = {NULL};

hrResult = m_pMessage->GetRecipientTable(
MAPI_UNICODE,
&m_pMsgRecipientsTable
);


if( FAILED( hrResult ) )
goto EXIT;

/*
hrResult =
m_pMsgRecipientsTable->SetColumns( (LPSPropTagArray)&Columns, 0 );

if( FAILED( hrResult ) )
goto EXIT;
*/

while( !FAILED( hrResult = m_pMsgRecipientsTable->QueryRows( 1, 0,
&pRows ) ) )
{
if( pRows->cRows == 0)
break;

/*
If I don't use SetColumns function, how can I indicate
PR_EMAIL_ADDRESS property?
*/

if( pRows->aRow[0].lpProps[ePR_EMAIL_ADDRESS].Value.lpszW != NULL )
{
MessageBox( NULL,
pRows->aRow[0].lpProps[ePR_EMAIL_ADDRESS].Value.lpszW, TEXT( "E-mail
address" ), MB_OK );
}
}

--------------------------------------------------------------------------------

I tried in this way:

pRows->aRow[0].lpProps[ 0 ].Value.lpszW

but "lpszW" is always NULL.


Could you provide me with a code sample that returns message recipients?

Best regards,
Iliyan Peychev

Re: MAPI retrieve recipients of a message by Nav

Nav
Thu Jun 17 14:45:54 CDT 2004

You can go through the pRows->aRow[] array to look at all the properties
available for each recipient. For example:

pRow = &pRows->aRow[0];

// Go through the details of this recipient...
for(ulSearch = 0; ulSearch < pRow->cValues; ulSearch++)
{
if(pRow->lpProps[ulSearch].ulPropTag == PR_EMAIL_ADDRESS)
{
pszwFullEmail = pRow->lpProps[ulSearch].Value.lpszW;
}
}

--
Nav Mehta [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.

"Iliyan Peychev" <Iliyan.Peychev@iss-bg.com> wrote in message
news:opr9qathwpmizc53@chronos...
> Hi,
>
> What did you mean, I shouldn't use "SetColumns" function?
>
> QueryRows function should be used after SetColums, doesn't it?
>
> How can I indicate "PR_EMAIL_ADDRESS" without using "SetColumns"? Look at
> the following example:
>
> --------------------------------------------------------------------------
------
>
> enum {
> ePR_EMAIL_ADDRESS,
> NUM_COLS};
>
> static SizedSPropTagArray(NUM_COLS, Columns) =
> {
> NUM_COLS,
> PR_EMAIL_ADDRESS
> };
>
> LPSPropValue lpProp = {NULL};
>
> hrResult = m_pMessage->GetRecipientTable(
> MAPI_UNICODE,
> &m_pMsgRecipientsTable
> );
>
>
> if( FAILED( hrResult ) )
> goto EXIT;
>
> /*
> hrResult =
> m_pMsgRecipientsTable->SetColumns( (LPSPropTagArray)&Columns, 0 );
>
> if( FAILED( hrResult ) )
> goto EXIT;
> */
>
> while( !FAILED( hrResult = m_pMsgRecipientsTable->QueryRows( 1, 0,
> &pRows ) ) )
> {
> if( pRows->cRows == 0)
> break;
>
> /*
> If I don't use SetColumns function, how can I indicate
> PR_EMAIL_ADDRESS property?
> */
>
> if( pRows->aRow[0].lpProps[ePR_EMAIL_ADDRESS].Value.lpszW !=
NULL )
> {
> MessageBox( NULL,
> pRows->aRow[0].lpProps[ePR_EMAIL_ADDRESS].Value.lpszW, TEXT( "E-mail
> address" ), MB_OK );
> }
> }
>
> --------------------------------------------------------------------------
------
>
> I tried in this way:
>
> pRows->aRow[0].lpProps[ 0 ].Value.lpszW
>
> but "lpszW" is always NULL.
>
>
> Could you provide me with a code sample that returns message recipients?
>
> Best regards,
> Iliyan Peychev