A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

vb6 DoEvents locks up Outlook 2007 when new mailitem is opened...



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 5th 07, 09:00 PM posted to microsoft.public.outlook.program_addins
Chris Smith[_2_]
external usenet poster
 
Posts: 1
Default vb6 DoEvents locks up Outlook 2007 when new mailitem is opened...

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
  #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



  #3  
Old October 5th 07, 11:07 PM posted to microsoft.public.outlook.program_addins
Chris Smith[_3_]
external usenet poster
 
Posts: 2
Default vb6 DoEvents locks up Outlook 2007 when new mailitem is opened

Thanks for the message. Looking for shortest path to a resolution here before
considering additional threading code.

I would agree that using DoEvents in Outlook 2007 may steal messages but in
previous Outlook versions it did not exhibit this behavior. I read in group a
posting "Subject: Accessing Outlook while addin is running - 7/9/2007" that
Ken Slovak suggested using System.Windows.Forms.DoEvents. I don't currently
see a way to access that in vb6 because it is .Net.

Is there an alternative function for DoEvents that can be accessed by vb6 to
use in a COM Add-in for Outlook 2007?

Thanks again,
Chris Smith


"Dmitry Streblechenko" wrote:

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




  #4  
Old October 6th 07, 01:55 AM 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

No, whether you call DoEvents in VB6 or System.Windows.Forms.DoEvents in
..Net won't make a difference; they all do the same thing.
A separate thread is the way to go.

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

"Chris Smith" wrote in message
...
Thanks for the message. Looking for shortest path to a resolution here
before
considering additional threading code.

I would agree that using DoEvents in Outlook 2007 may steal messages but
in
previous Outlook versions it did not exhibit this behavior. I read in
group a
posting "Subject: Accessing Outlook while addin is running - 7/9/2007"
that
Ken Slovak suggested using System.Windows.Forms.DoEvents. I don't
currently
see a way to access that in vb6 because it is .Net.

Is there an alternative function for DoEvents that can be accessed by vb6
to
use in a COM Add-in for Outlook 2007?

Thanks again,
Chris Smith


"Dmitry Streblechenko" wrote:

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






 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2007 locks up after upgrade from 2003 Bob Kelley Outlook - Installation 2 November 5th 07 02:22 PM
Outlook 2007 Locks up steveb Outlook - General Queries 6 March 12th 07 04:53 PM
Outlook locks up immediately when opened David Mursch Outlook - General Queries 11 February 7th 07 03:14 PM
Outlook 2007 locks up when started Soaring_Eagle Outlook - General Queries 2 January 12th 07 02:45 PM
Creating an Outlook MailItem when Outlook hasn't been opened WhytheQ Outlook and VBA 1 May 11th 06 12:41 AM


All times are GMT +1. The time now is 08:18 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.