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

<p>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?</p>

[{'answer_id': 74420, 'author': 'Lars Truijens', 'author_id': 1242, 'author_profile': 'https://Stackoverflow.com/users/1242', 'pm_score': 2, 'selected': False, 'text': '<p>Yes. That is possible using <a href="http://msdn.microsoft.com/en-us/library/f07c8z1c.aspx" rel="nofollow noreferrer">Com Callable Wrappers</a>. Basically you are enabling your .Net classes to be called through COM/ActiveX from your win32 code (Delphi or C++).</p>\n'}, {'answer_id': 74441, 'author': 'Karg', 'author_id': 12685, 'author_profile': 'https://Stackoverflow.com/users/12685', 'pm_score': 3, 'selected': False, 'text': '<p>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.</p>\n\n<p>From MSDN: <a href="http://msdn.microsoft.com/en-us/library/9x0wh2z3.aspx" rel="noreferrer">Hosting the Common Language Runtime</a></p>\n'}, {'answer_id': 74456, 'author': 'Lars Fosdal', 'author_id': 10002, 'author_profile': 'https://Stackoverflow.com/users/10002', 'pm_score': 4, 'selected': True, 'text': '<p>Yes.  Delphi for Win32 example here: <a href="http://interop.managed-vcl.com/" rel="noreferrer">http://interop.managed-vcl.com/</a><br>\nShows how to use a C# as well as a Delphi.NET assembly from Delphi for Win32.</p>\n'}, {'answer_id': 75252, 'author': 'Vegar', 'author_id': 11956, 'author_profile': 'https://Stackoverflow.com/users/11956', 'pm_score': 0, 'selected': False, 'text': '<p>Have you seen <a href="http://www.remobjects.com/product/?id=%7BB6BD1030-F630-4DA8-9018-73C03265A0EF%7D" rel="nofollow noreferrer">Hydra</a> from RemObjects? I have no experience with it, but from the intro, it looks relevant.</p>\n'}, {'answer_id': 934717, 'author': 'fuzzyman', 'author_id': 5341, 'author_profile': 'https://Stackoverflow.com/users/5341', 'pm_score': 2, 'selected': False, 'text': '<p>Why not embed CPython instead, which has an API intended to be used directly from C/C++. You lose the multiple language advantage but probably gain simplicity.</p>\n'}, {'answer_id': 2351140, 'author': 'Lukas Cenovsky', 'author_id': 138803, 'author_profile': 'https://Stackoverflow.com/users/138803', 'pm_score': 2, 'selected': False, 'text': '<p>I use <a href="http://sites.google.com/site/robertgiesecke/Home/uploads/unmanagedexports" rel="nofollow noreferrer">Unmanaged Exports</a> to created interface to IronPython script engine in C#. Be carefull when you use .NET code from Win32 Delphi - you have to use <code>Set8087CW($133F);</code> to change floating point exception behavior.</p>\n'}]
['https://Stackoverflow.com/questions/74386', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/12999/']