1

We would like to open some Delphi (win32) forms from .NET and embed the Delphi Form in a .NET MDI-form. If we just call the exported method in our Delphi DLL it is no problem to embed the form, however then we have problems with shortcuts and keyboard events in general. We believe that it’s because of incompatible messageloops. We’ve then tried to execute an Application.Run in the exported procedures in our Delphi DLL’s on a separate .NET-thread and it works the first time, but fails when we try to open the form more than once. Does anyone know how to interop the way we would like to do it: embed a win32 Delphi Form in a .NET Winform?

@All: First of all, thanks for your responses We found a solution to our problem: We moved the Delphi Application.Run into the exported procedure that starts the windows.

4

2 に答える 2

2

ソースがある場合は、.NET コードを生成する Delphi Prism に移植してみることができます。ただし、VCL を使用している場合は、困難な戦いを繰り広げています。Delphi 2006 には VCL の .NET 実装がありましたが、Prism は VCL アダプタを持たない .NET 用の単なる Object Pascal です。

利用可能な別のツールはHydraです。個人的には使用していませんが、.NET と「レガシー」Delphi 間の相互運用性を提供すると主張しています。彼らが主張するように機能する場合、古い Delphi コードを .NET アプリケーションに移行するための最善の策かもしれません。

于 2012-02-10T15:06:59.543 に答える
0

I would probably run the Delphi application in a separate process, set the parent window for the Delphi windows to your MDI container (instead of the default: the desktop, referenced by HWND 0), and marshal any necessary data between processes using typical inter-process messaging.

Then again, this is essentially the same as exposing your form as an ActiveX object. I just like to take Google Chrome's approach and isolate windows/tabs into separate processes.

于 2012-02-10T13:43:22.163 に答える