Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using DLR from Unmanaged Code

Is it possible to call managed code, specifically IronRuby or IronPython from unamanaged code such as C++ or Delphi?

For example, we have an application written in Delphi that is being moved to C#.NET We'd like to provide Ruby or Python scripting in our new application to replace VBSCRIPT. However, we would need to provide Ruby/Python scripting in the old Delphi application. Is it possible to use the managed dlls provided by IronRuby/IronPython from Delphi code?

like image 624
Bob Wintemberg Avatar asked Sep 16 '08 16:09

Bob Wintemberg


2 Answers

Yes. Delphi for Win32 example here: http://interop.managed-vcl.com/
Shows how to use a C# as well as a Delphi.NET assembly from Delphi for Win32.

like image 194
Lars Fosdal Avatar answered Oct 03 '22 06:10

Lars Fosdal


It is possible to host the CLR or DLR in unmanaged code as it is a COM component. From that point you can load the managed assemblies you need to interact with.

From MSDN: Hosting the Common Language Runtime

like image 36
Karg Avatar answered Oct 03 '22 05:10

Karg