Re: MAPI Problem with HrSetOneProp()

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Dmitry Streblechenko \(MVP\) (dmitry_at_dimastr.com)
Date: 06/19/04


Date: Fri, 18 Jun 2004 20:59:46 -0700

Note that lppPropNames in GetIDsFromNames is a double pointer (pointer to a
pointer), but you are passing a single pointer.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Luis" <lfpks0-g@yahoo.com> wrote in message
news:855c76bf.0406180734.f3bf239@posting.google.com...
> Hi,
>
> Not sure if this is the right forum, but I'm trying to implement an
> Exchange Extension and I just wanted to know if anyone can help me
> figure out why when I try to set/create a custom property using
> HrSetOneProp() with the MAPI_CREATE flag, it does not propely set the
> GUID. OutlookSpy shows it as {00000000-0000-0000-0000-000000000000}.
>
> Here are the details from OutlookSpy:
> Tag Num: 0x809B001E
> Tag Sym: 0x809B
> Type: PT_STRING8
> Value: My Value
> GUID: {00000000-0000-0000-0000-000000000000}
> Kind: MNID_ID
> ID: 0xC0
> OOM:
>
> Here is the code snippet which I'm calling from OnWriteComplete()
> function:
> LPMESSAGE lpMessage = NULL;
> LPMDB lpMdb = NULL;
> HRESULT hr = NULL;
> LPSPropTagArray pProps = NULL;
>
> if (SUCCEEDED(lpeecb->GetObject(&lpMdb, (LPMAPIPROP*) &lpMessage)))
> {
> MAPINAMEID mnid[1];
> // {00020386-0000-0000-C000-000000000046} -> GUID For X-Headers
> GUID guid = {0x00020386, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00,
> 0x00, 0x00, 0x00, 0x46} };
> mnid[0].lpguid = &guid;
> mnid[0].ulKind = MNID_STRING;
> mnid[0].Kind.lpwstrName = L"X-My-Header";
>
> hr = lpMessage->GetIDsFromNames(1, (LPMAPINAMEID*)&mnid,
> MAPI_CREATE, &pProps);
>
> if (SUCCEEDED(hr))
> {
> SPropValue pv;
>
> pv.ulPropTag = (pProps->aulPropTag[0] & 0xFFFF0000) | PT_STRING8;
> pv.Value.lpszA = "My Value";
>
> hr = HrSetOneProp(lpMessage, &pv);
>
> if(!SUCCEEDED(hr)){
> char buffer[] = "OnWriteComplete: HrSetOneProp Failed!";
> MessageBox(NULL, buffer, "Test Extension", MB_OK);
> }
> }
>
> I'm trying to place a custom x-header on the email message.
> OutlookSpy seems to see the property but the wrong GUID. The x-header
> never gets placed on the outgoing message. I'm using msvc6, OL2000,
> W2k sp6.
>
> Can anybody tell me what's wrong with this or how to fix it? Many
> thanks...



Relevant Pages

  • Re: MAPI Problem with HrSetOneProp()
    ... Note that lppPropNames in GetIDsFromNames is a double pointer (pointer to a ... OutlookSpy - Outlook, CDO ... > Tag Num: 0x809B001E ... > I'm trying to place a custom x-header on the email message. ...
    (microsoft.public.win32.programmer.messaging)
  • Re: MAPI Problem with HrSetOneProp()
    ... Thank you so much for OutlookSpy. ... > Note that lppPropNames in GetIDsFromNames is a double pointer (pointer to a ...
    (microsoft.public.win32.programmer.messaging)
  • Re: MAPI Problem with HrSetOneProp()
    ... Thank you so much for OutlookSpy. ... > Note that lppPropNames in GetIDsFromNames is a double pointer (pointer to a ...
    (microsoft.public.exchange.development)
  • Re: Forcing OL to terminate/restart
    ... Also make sure you set m_lRef to NULL in the destructor so ... that you don't return an invalid pointer from ExchEntryPoint if it is called ... OutlookSpy - Outlook, CDO ...
    (microsoft.public.win32.programmer.messaging)