![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
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: CComPtrIDispatch 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, |
#2
|
|||
|
|||
![]()
Which line of your code causes the crash?
-- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "Gabriel" wrote in message ... 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: CComPtrIDispatch 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, |
#3
|
|||
|
|||
![]()
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) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - |
#4
|
|||
|
|||
![]()
How do you create and initialize redMailPtr?
-- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "Gabriel" wrote in message ... 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) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - |
#5
|
|||
|
|||
![]()
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) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool |
#6
|
|||
|
|||
![]()
Of course. You simply declare a variable.
Have you tried redMailPtr.CreateInstance()? -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "Gabriel" wrote in message ... 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) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Newbie get_CurrentItem() question | Gabriel | Add-ins for Outlook | 6 | April 10th 09 05:49 PM |
Newbie Question | Robert | Add-ins for Outlook | 1 | July 14th 08 02:11 PM |
Quick Newbie Question | kalukaley | Outlook and VBA | 2 | February 1st 08 05:05 PM |
newbie question | msnews.microsoft.com | Add-ins for Outlook | 5 | January 21st 07 09:57 AM |
newbie question | Mike Archer | Outlook and VBA | 1 | July 17th 06 09:41 PM |