Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

Addin extra properties to MAPI messages

$
0
0

Hi!

On msdn website http://msdn.microsoft.com/de-de/library/cc765570.aspx following is written:

"MAPI Property Overview:...Clients can define properties to describe new message classes, and service providers can define properties to expose the unique features of their messaging system."

I ve been trying to add custom properties to MAPI messages, send and receive them. the problem is by receiving i get the error code 0x40380.

Inside my GetProperties() method the pProp parameter should have in its Value.l field 5, but it has l = 0x8004010f???

While sending the HRESULT is ok. Is it really possible to define custom properties and to receive them?

Ive defined my own PropertyTag as the following:

 

#define PROP_TAGEVO(ulPropType,ulPropID)    ((((ULONG)(ulPropID))<<16)|((ULONG)(ulPropType)))
#define PR_MESSAGE_FLAGSEVO                    PROP_TAGEVO( PT_LONG,        0x0081)


        void SetProperties()
        {

            const int nProperties=1;
            SPropValue props[nProperties] = {0};           
            /*props[0].ulPropTag=PR_ORIGINATOR_DELIVERY_REPORT_REQUESTED;
            props[0].Value.b = (unsigned short)true;*/
            props[0].ulPropTag=PR_MESSAGE_FLAGSEVO;
            props[0].Value.l = (LONG)5;

            HRESULT hr = m_pMapiMessage->SetProperties(nProperties, props);
           
        }

...

in MapiMessage.cpp SetSproperties Method:

HRESULT CMapiMessage::SetProperties(ULONG valueCount, SPropValue* lpProp)
{   
    if (!m_lpMessage)
    {
        return E_FAIL;
    }   
       
    return m_lpMessage->SetProps(valueCount, lpProp, NULL);
}

...SetProps() is the MAPI method.

My GetPToperty method:

void GetProperties()
        {

            LPSPropValue pProp;
            HRESULT hr = m_pMapiMessage->GetProperty(PR_MESSAGE_FLAGSEVO, pProp);
            BOOL bRead = ((pProp->Value.l & MSGFLAG_READ) == MSGFLAG_READ);
           
        }


automation eng. in programming

Viewing all articles
Browse latest Browse all 7132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>