Andriy
Guest
|
Hello,
We have an add-in that shows region over emails list, it works perfectly. But our customers see strange behavior, when outlook starts, our region does not contain switch arrows.
[img]https://imgur.com/a/gTVGpwU[/img]
We have detected that the reason of this behavior is a conflict with another add-in. Also we have contacted developers of this addin and identified exact line of code which coused this issue, this is 'System.Windows.Forms.Application.DoEvents();' call on addin startup. By the link below you can find test add-ins to duplicate this issue:
https://drive.google.com/open?id=1hk7wyqv6ScMpTcn4TEjciwNb0NCLnEE-
How can we fix this issue? |
|
Andrei Smolin
Add-in Express team
Posts: 18830
Joined: 2006-05-11
|
Hello Andriy,
Using DoEvents in an add-in opens a door to all sorts of problems. You should understand that an add-in is built on events; each event only occurs when the corresponding window message is sent to the host application's window. When you call DoEvents, you postpone executing the event handler of the current event in order to let the host application read all other messages; some of the messages show/hide/resize the window, this produces other events that your code handle; among the events processed there may be the event just postponed. This creates a mess to survive in which may be impossible. Say, commandbar controls and Ribbon controls may work incorrectly if DoEvents is used in code.
The issue that you experience obviously depends on the order in which these or those Window messages are sent to Outlook windows. I assume some message(s) is handled prematurely or too late. The real problem is: this depends on the machine, its performance and environment. No solution exists for this scenario. You need to stop calling DoEvents. Use a System.Windows.Forms.Timer object if you need to wait for something.
Andrei Smolin
Add-in Express Team Leader |
|
Andriy
Guest
|
Unfortunately I can not force development team of this addin to stop using DoEvent, also we may have other add-ins which use the DoEvent on starting and will couse the same behaviour.
We have checked this several machines, and on our side we always have the same result - panel without arrows (In case two of test add-ins are enabled). So for me this looks like call DoEvent on starting always couses this issue, have you checked provided add-ins on your side? |
|
Andrei Smolin
Add-in Express team
Posts: 18830
Joined: 2006-05-11
|
|