Urgent | How to call Delphi DLL using CSharp.Net

  • Thread starter Thread starter Anoop
  • Start date Start date
A

Anoop

Hi All,
I have a GUI module written in Delphi32. There is another main
application written in CSharp.Net. I want to call the delphi GUI Form from
with in CSharp.Net Code. The .Net application will provide the top level
container for the Delphi GUI module. The Delphi form will be invoked in the
following way:
1. A menu Item in the .Net [to call delphi module] container will trigger an
event
2. From with in the event handler I will call Delphi Dll Form and display it
as MDI Child

How can I do this integration? Any pointers would be highly appreciated!!

Regards!
-Anoop
 
You'll have to create a COM wrapper, or other kind of interface for your
GUI module to achieve this.
 
Google groups for 'How to get main for handle in .net'

Heres the example from the thread:

DllImport("user32.dll", SetLastError = true)]
private static extern bool ShowWindowAsync(IntPtr window, int cmd);
IntPtr hWnd = MyWindow.Handle; // must be a valid window handle
int SW_SHOW = 5;
bool success = ShowWindowAsync(hWnd, SW_SHOW);
 
I have never used COM. How should I create a COM wrapper? If someone have
ever done this kind of integration [C#.Net, Delphi] and could send me the
exact steps to be followed?

Wiebe Tijsma said:
You'll have to create a COM wrapper, or other kind of interface for your
GUI module to achieve this.
Hi All,
I have a GUI module written in Delphi32. There is another main
application written in CSharp.Net. I want to call the delphi GUI Form from
with in CSharp.Net Code. The .Net application will provide the top level
container for the Delphi GUI module. The Delphi form will be invoked in the
following way:
1. A menu Item in the .Net [to call delphi module] container will trigger an
event
2. From with in the event handler I will call Delphi Dll Form and display it
as MDI Child

How can I do this integration? Any pointers would be highly appreciated!!

Regards!
-Anoop
 
Back
Top