Hello Support Team,
I used the RichEditControl with a RichEditBarController and a BarManager for an Outlook addin based on windows forms.
As you can see in the attached addin, the bar buttons (e.g. redo, undo, copy, cut, font, font size) are not synchronous with the rich edit selected text.
I've tried the same code (copied from your RichEdit sample) in a windows application and there it works fine.
How can I fix this issue?
I've attached the windows forms application and the outlook addin. You can use the setup file (MyAddin1Setup(1.0.0).msi) to install the outlook addin.
Thanks allot!
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello Andreas,
Thank you for your sample. I have installed your Add-in, but I cannot see it in Outlook. Would you please clarify what I should do to test this Add-in in Outlook?
Thanks,
Alessandro.
Hello Alessandro,
I've attached a new version of the Outlook addin.
After the installation you should see another ribbon tab page with a button in Outlook.
The button click opens the rich edit form.
Hello Andreas,
Thank you for your update. I see the problem but it is unlikely related to our XtraRichEdit Suite. Most probably, it is specific to the Outlook environment. I can only assume that the standard message loop is not launched in this environment. Please utilize the Application.Run Method in your Add-in to launch message loop manually. To my regret, I cannot test this solution in your sample because it is not compiled in my environment (see the attached screencast). However, I hope that this solution helps you. Also, I should mention that we do not guarantee that our components can be accessed in non-.NET environment. Please feel free to ask for clarification if necessary. We will be glad to help you.
Thanks,
Alessandro.
Hello Alessandro,
Thanks for your answer. The addin is isolate with separate application domain based on the .net Framework.
If you want to debug this issue, replace the DevExpress assemblies (required for RichEdit) with your debug Assemblies in the addin installation folder and hook the debugger to the Outlook process.
Therefor you don’t have to start addin code.
Hello Andreas,
<<<
The addin is isolate with separate application domain based on the .net Framework.
>>>
I am afraid that even if the Add-in is isolated into a separate AppDomain it is not sufficient for correct WinForms control operation. At least, they require a message loop (see my previous message) to function correctly. I have replicated the same issue in a regular WinForms application by replacing the standard message loop with Application.DoEvents() method calls (see the attached screencast). So, I think that my assumption concerning the message loop is correct. Please feel free to ask for clarification if necessary. We will be glad to help you.
Thanks,
Alessandro.
Hello Alessandro,
Thanks allot for your reply. I've tested the addin with the "Form.ShowDialog" and "Form.Show" methods.
The problem occurs only in the "Form.ShowDialog" case, if the dialog is called modal. In the "Form.Show" case, the controls work synchronously to the rich edit control.
Why blocks “Application.DoEvents” the message loop and is there a solution to force the message loop?
The "Application.MessageLoop" property of the addin is set to "true".
Hello Andreas,
Thank you for your update. It seems very strange because this issue is not replicated in a regular .NET application even if the Application.Run() method is not called (see the attached screenshot). Thus, I believe that this issue is specific to COM. Please try recommendations from corresponding forums and sites. Here are some examples:
How to: Support COM Interop by Displaying Each Windows Form on Its Own Thread
How to: Support COM Interop by Displaying Windows Forms on a Shared Thread
Why does ShowDialog not block the UI thread completely.
Thanks,
Alessandro.
Thanks allot, we had fixed that issue