I have an application in Delphi 6, and due to library issues, I need to write a component in C# or C++ that will exist on a Delphi form. The program is currently Delphi and C#, and it calls C# for dialogs. I need something embedded into a TForm that will allow me to draw that component in C#.
I think I can create a component in Delphi and during its Paint routine I just call the function in the DLL. But what do I pass to the C# DLL so that it can paint in that window, and how would I get C# to actually do it?
I guess just being able to paint in some arbitrary DC on demand in C# is all I need to do.
C#
Delphi:
It’s silly to load an unload on each paint, but for example purposes it works.
For anyone else trying to do this, you will need to google “Reverse P/Invoke” to be able to see the C# DLL procedure in another language.
Example Reverse P/Invoke
http://www.blong.com/Conferences/BorConUK2002/Interop1/Win32AndDotNetInterop.htm