 |
|
|
|
| Author |
Message |
Chris Smith
Joined: 13 Aug 2007 Posts: 1
|
Posted: Fri Oct 05, 2007 4:00 pm Post subject: vb6 DoEvents locks up Outlook 2007 when new mailitem is open |
|
|
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
Archived from group: microsoft>public>outlook>program_addins |
|
| Back to top |
|
 |
Dmitry Streblechenko
Joined: 12 Aug 2007 Posts: 220
|
Posted: Fri Oct 05, 2007 5:22 pm Post subject: Re: vb6 DoEvents locks up Outlook 2007 when new mailitem is |
|
|
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" wrote in message @microsoft.com...
>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 |
|
| Back to top |
|
 |
Chris Smith
Joined: 05 Oct 2007 Posts: 1
|
Posted: Fri Oct 05, 2007 6:07 pm Post subject: Re: vb6 DoEvents locks up Outlook 2007 when new mailitem is |
|
|
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" wrote in message
> @microsoft.com...
> >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
>
>
> |
|
| Back to top |
|
 |
Dmitry Streblechenko
Joined: 12 Aug 2007 Posts: 220
|
Posted: Fri Oct 05, 2007 8:55 pm Post subject: Re: vb6 DoEvents locks up Outlook 2007 when new mailitem is |
|
|
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 @microsoft.com...
> 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" wrote in message
>> @microsoft.com...
>> >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
>>
>>
>>
|
|
| Back to top |
|
 |
|
|
| Related Topics: | Mailitem save as getting Operation Failed I created a OutLook Addinns using VSTO 2005 C# 2.0. the functionality is on right-click on any mail item, save onto sharepoint document lib. It's working fine when the subject got simple text. If the subject got special CHRs or if the mail was replied or
Error deleting second attach from RTF Msg w/ Outlook 2007 I get an error, 0x80030002 "%1 could not be found.", when I try to delete the second attachment from an rtf email message only in Outlook 2007. The first attachment gets processed with no problems. I've tried getting a new and a
Compile Addin for OL 2000 thru 2007 I have an addin for Outlook that works in 2000 thru 2003. It also works in 2007 with a few changes. However, the 2007 version puts the buttons in the Add-Ins tab. I have made changes to customize the Ribbon with my own tab & everything works if I compile
Live Local add-in for Outlook fails install I have Win XP SP2, Office 2003 SP2. I had the beta version of Windows Live Local add-in for Outlook, which stopped working when IE7 was out. So I uninstalled the add-in using Add/Remove programs. The Windows Live Local add-in does not appear in my Add/
Outlook crashes during shutdown after running operation I have a COM addin (VB6), that had run without error until recently. When the following code is run, the microsoft error reporting window comes up when outlook is closing after the and after the events. Private Sub ExecuteBu |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|