Bug Report B192588
Visible to All Users

XtraRichEdit in MFC dialog: Text can't be edited.

created 14 years ago

I am attempting to insert the XtraRichEditControl into a MFC dialog using the CWinFormsControl wrapper class with a .Net user control. I am able to get the form to show up. However, only certain keys are taking effect on the control (space, backspace, delete, arrows), but any character keys (A-z, 1-0), the form just emits a beep and the characters do not show up.
To determine if this was an issue with the CWinFormsControl class, I created a sample code .Net user control with both a DevExpress XtraRichEdit control and a normal .Net textbox. I then placed that user control into the MFC dialog as before. *I have attached said sample code to this ticket* When I run this sample code, I am able to type as normal into the .Net text box, but again not into the XtraRichEdit control. Also, I noticed when I run the MFC code with the debugger attached, I am getting the following warning in Visual Studio's output window when ever I type a character in the XtraRichEdit control: "Warning: control has no IDispatch interface."
At first I figured that the MFC dialog might be eating the key down event, but when I put in a debug line into the OnKeyDown event on the XtraRichEdit control, it does print the debug message, so I know that the event is being fired by the control itself. *This debug statement is in the sample code as well*
So I am left asking the question, do the XtraRichEdit controls support being put into MFC dialogs, or am I doing some incorrect event plumbing? Any help would be greatly appreciated.
Thank you for your time on this issue.

Comments (3)

    Hi Alan,
    Thank you for contacting us. It seems that your report refers to the UserControl with XtraRichEdit thread. Please review it and let us know if the problem still exists.
    Thanks,
    Sergi

      I have reviewed the ticket that you pointed me to, and I do believe that my issue is related. However, I still believe the issue is in your control, because the .Net edit box which exists in the same user control as the XtraRichEdit control does receive the KeyPress event, which leads me to believe that the .Net user control is getting handed the KeyPress message, but the XtraRichEdit doesn't actually get the message. Perhaps this has something to do with the Warning that is getting sent to the output window of Visual Studio every time I press a key when the control has focus:
         Warning: control has no IDispatch interface.
      From what I can find, this interface is a key component in "late binding" of controls in .Net so that they can be used in CLR code in order to use the Invoke method that is implemented by IDispatch. Looking at all of the .Net forms control, they all have the following definition associated with them
         [ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)]
         [ComVisibleAttribute(true)]
      I am wondering if the issue that I am seeing is resulting from the XtraRichEdit control not actually having the ClassInterfaceAttribute.AutoDispatch signature. According to MSDN documentation (http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.classinterfacetype.aspx), this signature exposes the class's interface to CLR in a derived IDispatch interface.

        Hi Alan,
        Currently, we are investigating this issue. We will contact you once we have any results or need extra information. Thank you for your patience.
        Thanks,
        Sergi

        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.