G
George Wang
Hello, there:
I'm implementing an Outlook COM Add-in which captures item open event.
Because this guy will do some lengthy thing, so I just save the item
EntryID and close it right away.
At backend, the Add-in will do its work. After completed, it will use
GetItemFromID() get the item and call its Display() method to display
it. But after the item shows up, Outlook will crash.
=== excerpt of pseudo code ======
IDTExtensibility2::OnConnection(..)
{
// store pointer of Outlook Application
}
MailItemEvents::Open(..)
{
// store item Entry ID and store Entry ID
// start a UI display progress and a worker thread to the job
// close MailItem
}
=================================
After worker thread completes, UI thread use Outlook Application ->
get NameSpace -> GetItemFromID(Entry ID + Store ID).
So far no problem. But when call the Item:isplay method, Outlook
will crash.
Maybe the item.Display method can only be called from an Outlook
thread? Is there a workaround?
Thanks!
-G
I'm implementing an Outlook COM Add-in which captures item open event.
Because this guy will do some lengthy thing, so I just save the item
EntryID and close it right away.
At backend, the Add-in will do its work. After completed, it will use
GetItemFromID() get the item and call its Display() method to display
it. But after the item shows up, Outlook will crash.
=== excerpt of pseudo code ======
IDTExtensibility2::OnConnection(..)
{
// store pointer of Outlook Application
}
MailItemEvents::Open(..)
{
// store item Entry ID and store Entry ID
// start a UI display progress and a worker thread to the job
// close MailItem
}
=================================
After worker thread completes, UI thread use Outlook Application ->
get NameSpace -> GetItemFromID(Entry ID + Store ID).
So far no problem. But when call the Item:isplay method, Outlook
will crash.
Maybe the item.Display method can only be called from an Outlook
thread? Is there a workaround?
Thanks!
-G