View Single Post
  #2  
Old October 5th 07, 10:22 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default vb6 DoEvents locks up Outlook 2007 when new mailitem is opened...

You should not be using DoEvents in a COM add-in - it is essentially calling
GetMessage/TranslateMessage/DispatchMessage. These functions must be called
by Outlook, not by your code; you are probably ending up stealing some
messages that Outlook is expecting.
If you have a long loop, use a separate thread.

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

"Chris Smith" Chris wrote in message
...
I have been using vb6 to build a COM Add-in for Outlook. There are parts of
the code that run in a long loop and require a DoEvents. In the case of
Outlook 2007, all is fine until a new mailitem is opened and user starts
typing an email. Once the user starts typing and a DoEvents it triggered
by
the Add-in in the background then Outlook locks up indefinitely using 100%
CPU.

I have went through and eliminated any unnecessary DoEvents but if I
remove
all of them then Outlook stalls until the large loops are completed.

This does not occur in Outlook 2000, 2002 or 2003.

Any suggestions?

Thanks,
Chris Smith



Ads