There are a few ways to pass data back and forth, depending on how you want
to implement something like that.
The simplest way is a set of public or internal data that both threads have
access to.
You can also get the thread context of the main thread and store that in an
accessible place, then a call from the background thread can pass data to a
procedure and synch that using a SendOrPost() callback.
I often use that methodology for WordMail related things for Outlook 2003,
where Word is running on a different thread than the Outlook process.
--
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 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.