SyntaxEditor doesn't work within a COM library?

SyntaxEditor for Windows Forms Forum

Posted 16 years ago by Jeff Brown
I'm having a problem with SyntaxEditor that will be a show-stopper if it can't be resolved.

I drop a SyntaxEditor control onto a Form, make no changes to its properties, and run my application. Everything is fine.

Now, I do the same thing with a Form that's launched from within a COM library -- i.e., a .NET class library that has a COM interface.

When I invoke that library from a COM client application, I find that any non-printable keystrokes -- e.g., backspace and arrow keys -- are completely unresponsive within the SyntaxEditor control.

I've used many native and third-party .NET controls, and SyntaxEditor is the only one I've encountered that demonstrates this symptom.

Any ideas? Thanks for any help.

Versions & technical info:

Visual Studio .NET 2003 7.1.3088
.NET Framework 1.1.4322 SP1
SyntaxEditor 2.5.0160
.NET COM library written in C#
COM test client application written in VB 6

Comments (2)

Posted 16 years ago by Jeff Brown
Okay, I've solved my own problem. You may be interested in what I did, in case this impacts future implementations of SyntaxEditor.

I compared trace dumps of the event methods that were called in both the "pure .NET" and the COM versions of my application.

I noticed that one difference was that the "pure .NET" version called SyntaxEditor.PreProcessMessage (which the COM version didn't), and the COM version called SyntaxEditor.ProcessKeyEventArgs (which the "pure .NET" version didn't).

So, I created a derivation of SyntaxEditor, and overloaded ProcessEventArgs as follows:
protected override bool ProcessKeyEventArgs(ref Message m)
    bool result = base.PreProcessMessage(ref m);
    if (!result)
        result = base.ProcessKeyEventArgs(ref m);
    return result;
And, now it works fine in both environments!

There are still a few weird problems I need to work out, but this was the show stopper.

[Modified at 08/30/2005 10:37 AM]
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Great Jeff... thanks for posting the info for others!

Actipro Software Support

The latest build of this product (v21.1.0) was released 24 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.