Newbie Redemption ISafeMailItemPtr question

Status
Not open for further replies.
R

R2FicmllbA

Hi, back with another probably trivial question. I want to use Redemption to

access the headers of a message in my ATL/COM add-in. I thought that to set

my ISafeMailItemPtr object I just need to do this:

CComPtr<IDispatch> dispItem;

hr = spSelection->Item(nItem,&dispItem);

Redemption::ISafeMailItemPtr redMailPtr;

redMailPtr->put_Item(dispItem);

However Outlook (2003) crashes with an "abnormal program termination" error.

I know dispItem is getting set correctly as I'm using it elsewhere in that

method without issue. Is there something obvious I'm missing here?

Much obliged as always,
 
D

Dmitry Streblechenko

Which line of your code causes the crash?

Dmitry Streblechenko (MVP)

-

"Gabriel" <Gabriel> wrote in message

news:7E517503-573E-41DE-88EE-2716769488B6@microsoft.com...
> Hi, back with another probably trivial question. I want to use Redemption
> to
> access the headers of a message in my ATL/COM add-in. I thought that to
> set
> my ISafeMailItemPtr object I just need to do this:

> CComPtr<IDispatch> dispItem;

> hr = spSelection->Item(nItem,&dispItem);

> Redemption::ISafeMailItemPtr redMailPtr;

> redMailPtr->put_Item(dispItem);

> However Outlook (2003) crashes with an "abnormal program termination"
> error.
> I know dispItem is getting set correctly as I'm using it elsewhere in that
> method without issue. Is there something obvious I'm missing here?

> Much obliged as always,
>
 
R

R2FicmllbA

Hi Dmitry,

"redMailPtr->put_Item(dispItem)" causes the crash. I can comment that line

out and the method runs fine. (I'm not actually doing anything with the

object yet.) Just to make sure I didn't botch this up, to use Redemption I'm

just putting this in my StdAfx.h file, mimicking the import lines for the

Outlook/Office object models:

#import "C:\Program Files\Redemption\Redemption.dll" rename_namespace(

"Redemption" ), named_guids

using namespace Redemption;

Is this correct? Let me know if you need more information. Thanks again for

your assistance.

-Gabriel

"Dmitry Streblechenko" wrote:


> Which line of your code causes the crash?

> > Dmitry Streblechenko (MVP)
>

>

>

> -
 
D

Dmitry Streblechenko

How do you create and initialize redMailPtr?

Dmitry Streblechenko (MVP)

-

"Gabriel" <Gabriel> wrote in message

news:6EB14B0E-1502-4627-A2BE-BAE2777D53BD@microsoft.com...
> Hi Dmitry,

> "redMailPtr->put_Item(dispItem)" causes the crash. I can comment that line
> out and the method runs fine. (I'm not actually doing anything with the
> object yet.) Just to make sure I didn't botch this up, to use Redemption
> I'm
> just putting this in my StdAfx.h file, mimicking the import lines for the
> Outlook/Office object models:

> #import "C:\Program Files\Redemption\Redemption.dll" rename_namespace(
> "Redemption" ), named_guids

> using namespace Redemption;

> Is this correct? Let me know if you need more information. Thanks again
> for
> your assistance.

> -Gabriel

> "Dmitry Streblechenko" wrote:
>
> > Which line of your code causes the crash?
>

>> > > Dmitry Streblechenko (MVP)
> >

> >

> >

> > -
 
R

R2FicmllbA

Hi again Dmitry,

I thought that's what

Redemption::ISafeMailItemPtr redMailPtr;

redMailPtr->put_Item(dispItem);

did, creating a ISafeMailItemPtr object and passing an item to it. Should I

be creating an ISafeMailItem instead of Ptr?

Thanks again,

-Gabriel

"Dmitry Streblechenko" wrote:


> How do you create and initialize redMailPtr?

> > Dmitry Streblechenko (MVP)
>

>

>
 
D

Dmitry Streblechenko

Of course. You simply declare a variable.

Have you tried redMailPtr.CreateInstance()?

Dmitry Streblechenko (MVP)

-

"Gabriel" <Gabriel> wrote in message

news:0A2C19B3-1F54-446C-BEF9-ECFF57BAFAF5@microsoft.com...
> Hi again Dmitry,

> I thought that's what

> Redemption::ISafeMailItemPtr redMailPtr;
> redMailPtr->put_Item(dispItem);

> did, creating a ISafeMailItemPtr object and passing an item to it. Should
> I
> be creating an ISafeMailItem instead of Ptr?

> Thanks again,

> -Gabriel

> "Dmitry Streblechenko" wrote:
>
> > How do you create and initialize redMailPtr?
>

>> > > Dmitry Streblechenko (MVP)
> >

> >

> >
 
R

R2FicmllbA

Hi Dmitry,

That sorted me out. This is what I ended up doing:

CComVariant headers;

headers.vt = VT_BSTR;

Redemption::ISafeMailItemPtr redMailPtr;

redMailPtr.CreateInstance(__uuidof(Redemption::SafeMailItem));

redMailPtr->put_Item(dispItem);

redMailPtr->get_Fields(0x7D001E, &headers);

One more newbie question just out of curiosity, why is it

"__uuidof(Redemption::SafeMailItem)" rather than

"__uuidof(Redemption::ISafeMailItem)"?

Thanks again for all your help!

-Gabriel

"Dmitry Streblechenko" wrote:


> Of course. You simply declare a variable.
> Have you tried redMailPtr.CreateInstance()?

> > Dmitry Streblechenko (MVP)
>

>

>

> -
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
O Newbie question: how to sync two Outlook -Exchange and IMAP- calendars? Using Outlook 4
C Newbie needs help with Outlook Macro Outlook VBA and Custom Forms 3
J Newbie confusion Using Outlook 0
E Newbie, desperately seeking help Using Outlook 2
S Seperating email accounts, Syncronizing, and a few newbie questions Using Outlook 5
C Newbie import issues Using Outlook 3
J Newbie needs help Outlook VBA and Custom Forms 2
A General, how to get started? [kwrds begin start newbie] Outlook VBA and Custom Forms 3
R Newbie get_CurrentItem() question Outlook VBA and Custom Forms 6
Y Newbie : What is http://schemas.microsoft.com all about? Outlook VBA and Custom Forms 2
A Edit subject - and change conversationTopic - using VBA and redemption Outlook VBA and Custom Forms 2
N Redemption VBA basics...something's missing Using Outlook 0
D Redemption? Need rapid pull of Outlook Contacts, email + notes for VBA Using Outlook 1
J 64-bit version of Redemption? Outlook VBA and Custom Forms 2
E Redemption access AppointmentItem Label from outlook Outlook VBA and Custom Forms 6
E Redemption MAPI access(c#) Outlook VBA and Custom Forms 4
W Redemption::RDOMail.PrintOut() / DoAction(maPrint) not working Outlook VBA and Custom Forms 1
B Use Redemption to get sender's email address Outlook VBA and Custom Forms 3
M EMail1Address and EMail1AddressType strangeness using Redemption Outlook VBA and Custom Forms 2
A Creating Redemption.MAPIUtils failed with Windows 7 x64 Outlook VBA and Custom Forms 5
D href tags does not result in the full url with Redemption Outlook VBA and Custom Forms 4
E Redemption Foldes.Add doesn't work Outlook VBA and Custom Forms 3
E Redemption Foldes.Add doesn't work Outlook VBA and Custom Forms 3
N Redemption.RDOSession logon() stops emails sending-they stay in Ou Outlook VBA and Custom Forms 3
E Should I switch to redemption Outlook VBA and Custom Forms 11
E Should I switch to redemption Outlook VBA and Custom Forms 11
C Redemption - Rules for outlook Outlook VBA and Custom Forms 1
G Error in Outlook Object Model with redemption and google apps prem Outlook VBA and Custom Forms 3
P Redemption Send EMail Outlook VBA and Custom Forms 10
S redemption reference Outlook VBA and Custom Forms 1
T Configure mailbox OutofOffice with Redemption Outlook Outlook VBA and Custom Forms 1
D redemption dll not registering in windows vista Outlook VBA and Custom Forms 3
Y Redemption MessageItem SaveAs problem Outlook VBA and Custom Forms 8
Q GAL.ResolveName issue with REDEMPTION Outlook VBA and Custom Forms 5
Q REDEMPTION HANGING during LOGON Outlook VBA and Custom Forms 2
P Redemption not working on OL2007 Outlook VBA and Custom Forms 2
P Redemption Send EMail fails Outlook VBA and Custom Forms 4
S delete appointmentitem permanently using redemption Outlook VBA and Custom Forms 2
D redemption - foldercreate event + delegate user Outlook VBA and Custom Forms 8
C Assign To and CC list while using Redemption.dll library Outlook VBA and Custom Forms 10
U Re: Read fields with Redemption Outlook VBA and Custom Forms 1
V redemption MAPIUtils Outlook VBA and Custom Forms 3

Similar threads

Top