Page 1 of 1

WPF Interop Problem

Posted: Fri Jan 07, 2011 9:59 am
by Andreas Tastler
Hi all

We started using Stimulsoft Reports with the winforms components. Now our main application will be migrated to WPF, but the reporting components should still be running by winforms (we did a lot of extensions in toolbar and menu). We have other components that still run with winforms.
When I start the Designer in dialog mode StiReport.Design(true) everything is working fine. But if I start the Designer non modal StiReport.Design(false), strange things with keyboard and menu happened.
Example 1: Deleting selected components by the DEL-Key is not working
Example 2: I open a menu entry in main menu, then I click on the desinger space or select a component, but the menu stays open

I tried this with an completely new WPF Application with a button on it. The click event contains the following basic code:

Code: Select all

StiReport stiReport = new StiReport();
stiReport.Design(false);
Can you help me with this problem?

Thank you
Andreas

WPF Interop Problem

Posted: Mon Jan 10, 2011 11:46 am
by Jan
Hello,

Unfortunately this problem can't be fixed. We have faced with this problem some years ago. This is how work WinForms in WPF environment. WPF application have own "message loop" and some messages from WinForms control is ignored. For example - keyboard events.

Thank you.

WPF Interop Problem

Posted: Tue Jan 11, 2011 12:01 am
by Andreas Tastler
Hi Jan

I found the following Method, which activates the interoperability between WPF and NonModal Windows Forms.
It has to be called before the WinForms windows will be opened and everything will be fine...

Code: Select all

System.Windows.Forms.Integration.WindowsFormsHost.EnableWindowsFormsInterop();
http://msdn.microsoft.com/en-us/library ... terop.aspx


Thank you for your hint...
Andreas


WPF Interop Problem

Posted: Tue Jan 11, 2011 12:20 am
by Jan
Hello Andreas,

Thank you for your information.