Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Add-Ins / October 2004

Tip: Looking for answers? Try searching our database.

Multithreading in Outlook

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vladimir Chtchetkine - 28 Oct 2004 15:40 GMT
Hi everybody!

Pretty much generic question :-) How do I do my own multithreading in
Outlook? Straight forward path has failed (just as I suspected :-) If
I create my own thread (using SDK's _beginthreadex call) there are
certain operations that lead to disaster :-) For instance, when I try
to get Actions (pretty much innocent, huh?) on a Mail item that I just
created (in the context of the same thread) Outlook throws "Unable to
install custom action" (or something similar to that) msg box and
hangs.
I tried (in three different attempts) to call CoInitialize,
CoInitializeEx(multithreaded) OleInitialize in the beginning of my
thread execution but neither one seemed to be able to change anything.
So, HOW DO I DO multithreading in Outlook?

TIA,

Vladimir
Dmitry Streblechenko \(MVP\) - 28 Oct 2004 18:27 GMT
Outlook Object Model is not multithread safe. Why exactly do you need a
separate thread? Is there a specific Outlook method that takes too long to
execute?

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

> Hi everybody!
>
[quoted text clipped - 14 lines]
>
> Vladimir
Vladimir Chtchetkine - 28 Oct 2004 21:48 GMT
Well, sort of solved. I need some comments (I mean I would appreciate
them) on the approach...
In my OnStartupComplete handler I create a (hidden) window and
whenever I need to touch outlook API from an arbitrary thread (that
I've created or my async events use) I send a message to that window
(so, I have some messaging protocol) and in my window's message
handler I actually do what I need using Outlook API. I tested on the
problem that inspired initial post and it works just fine. But I
wander if that's THE approach I should take. Any comments?

TIA,

Vladimir
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.