All threads that use Extended MAPI must call MAPIInitialize. Outlook calls
it on its main thread, but if you create your own secondary thread, that is
your responsibility.
All creatable Redemption objects (including RDOSession) do that. Try to
create an instance of the RDOSession object on the secondary thread, sets
its MAPIOBJECT property to Application.Session.MAPIOBJECT from Outlook to
make sure the two share the same MAPI sessio, then retrieve RDOMail.
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Sandeep K" wrote in message
...
Hi Ken,
The problem here is getting the information back from the background
worker
thread. My scenario is like this:
I do some processing based on the content of email and then based on the
result I update the mail object properties. As I am using a background
workder thread for processing email content, I can now pass the email
content
directly to the background worker. Now as background worker thread can not
access mail object, I believe I need the processing results to be passed
back
to Main thread. Is there a way to pass the result back to main thread so
that
It can set properties of the emails.
"Ken Slovak - [MVP - Outlook]" wrote:
Sure. Set up the code to run with server side MAPI on a machine that
never
has had Outlook installed.
What you want won't work. It will hang or crash Outlook and/or your addin
code. Think of a different method such as getting the information in the
foreground thread and then passing strings or whatever to the background
thread. Otherwise you're just causing yourself plus any other code
running
on that machine nothing but headaches.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
"Sandeep K" wrote in message
...
Hi,
I am using RDOMail object to retrieve email data and setting user
properties. RDOMail object works fine in the main thread, 'ThisAddin
thread',
(I am creating VSTO Add-in) but when I use same RDOObject in the worker
thread all function calls on the RDOMail object in debugger evaluates
to
error "Function evaluation disabled because a previous function
evaluation
timed out. You must continue execution to reenable function
evaluation.".
Any clue how can i use RDOMail object in worker thread which is
different
thread than ThisAddin thread.