View Single Post
  #6  
Old January 13th 09, 07:01 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Redemption Compiler problem

Of course you can't, these are two different objects - you need to create an
instance of the Redemption.SafeMailItem object, then set its *em* property
to an instance of the Outlook.MailItem object.

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

I do specify using namespace Redemption; following the import line.
#import "C:\\Program Files\\Redemption\\Redemption.dll" named_guids
using namespace Redemption;

I can compile now but I can't assign an Outlook::_MailItemPtr to
Redemption::ISafeMailItemPtr.

void CMailItemHandler::InlineImage(Outlook::_MailItemPt r mailPtr) //
(mailPtr obtained by calling Outlook::_InspectorPtr-GetCurrentItem())
{
Redemption::ISafeMailItemPtr pSMItem;
pSMItem = mailPtr; // pSMItem is NULL, stepping into the COM
code E_NOINTERFACE was returned somewhere in QueryInterface code

// I have also tried the following variations and the compiler
squaked at me for the assignments.
CComPtrRedemption::ISafeMailItem spSMItem;
Redemption::ISafeMailItem* pISMItem = NULL;

spSMItem = mailPtr;
pISMItem = mailPtr;
}

Thanks for the help!


On Jan 12, 7:14 pm, "Dmitry Streblechenko" wrote:
Do you specify the namespace when using #import?

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

...
I'm not using ATL.

On Jan 12, 3:01 pm, wrote:



On Jan 12, 11:46 am, Byron wrote:


I'm not well versed enough in COM to troubleshoot this problem. Any
help or suggestions will be greatly appreciated. TIA.


I am trying to use Redemption but I'm having trouble getting past a
compiler error. The error is:


c:\.......\OlSmPlug-In\ItemEventHandler.cpp(882): error C2079:
'sMailItem' uses undefined struct 'Redemption::SafeMailItem'.


Here is the simple decleration in my code in ItemEventHandler.cpp
(882)


Redemption::SafeMailItem sMailItem;


I ran the installer file you provide as part of the Redemption
download. Redemption does show up in Outlook's Add-In Manager and
it's checked. Here is my import statement and my SafeMailItem
decleration. #import "C:\\Program Files\\Redemption\\Redemption.dll"
The import statement is in the same header file as the office
mso.dll. I have no problem importing the Office/Outlook files.


The redemption.tlh and redemption.tli files are created in my Debug
directory. SafeMailItem is declared in the tlh file.


Here is my system info:


Window XP Pro


MS Visual Studio 2003 version7.1.6030


Outlook 2002 SP3 version 10.6838.6845


Redemption 4.6.0.924


You have to create an instance of the Redemption SafeMailItem and
initialize it. Are you using ATL?- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -



Ads