Redemption works on Outlook 2003 (and 2000 I think), but not on Outlook XP (2002)

  • Thread starter Thread starter dorutzu
  • Start date Start date
D

dorutzu

Hi,

I'm writing an Outlook add-in that uses the Redemption library.
Everything works just fine under Outlook 2003, but in Outlook XP it
doesn't avoid the annoying message "An application is...". Any ideas?
Is this a known problem under Outlook XP?
I also noticed question 9 from the redemption faq (Outlook XP
unstabile), and inserted MAPIUtils.Cleanup, but this still doesn't fix
my problem.

Any help or hint would be much appreciated. Thanks!
Doru K
 
Post a code snippet that shows the statement that triggers the security
prompt. Chances are you aren't fully using Redemption.
 
Please post the line of code that causes the prompt. Note that Outlook 2003
added Body and HTMLBody to the list of the blocked properties, you need to
access them using Redemption rather than OOM.

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

Well, I found where the problem lies, I didn't understand it, but I
worked around it.
In Outlook2000 (only - in 2002 and 2003 works just fine), I was
creating a thread that was waiting 10 seconds, and then calling a
method from the parent object(the one creating the thread). In this
method I found the problem:

CLSID clsid;
ISafeMailItemPtr pSafeMail = NULL;

if ((hr = ::CLSIDFromProgID(L"Redemption.SafeMailItem", &clsid)) !=
NOERROR)
return -1;

if ((hr = ::CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER,
__uuidof(ISafeMailItem), (void**)&pSafeMail)) != S_OK)
return -1; //HERE is the problem, I get a non-zero result for hr.

Now, the strange thing is that this works fine the first time the
thread is called, but not the second time. Also, if I call this method
directly from the object(not the thread), it works fine, no matter how
may times I call it.
Any ideas?
To make it work, I declared my pSafeMail global, initialized it in
the object's constructor, and worked with it that way, eliminating the
code above from my method. But could you tell me what it really going
on? Thanks!

Many thanks,
Doru K
 
Back
Top