Calling DLL's from Ruby

D

dkmd_nielsen

I've written quite a bit of logic into DLL's using C#. I would like
to leverage that logic in my Ruby scripts, but I am unsure where to
start or how to start. I've installed RubyClr, but no documentation
installed with it.

Is RubyClr the correct path to take? Where can I find examples?
Should I be looking elsewhere?

Any and all recommendations are appreciated.
dvn
 
B

brabuhr

I've written quite a bit of logic into DLL's using C#. I would like
to leverage that logic in my Ruby scripts, but I am unsure where to
start or how to start. I've installed RubyClr, but no documentation
installed with it.

Is RubyClr the correct path to take? Where can I find examples?
Should I be looking elsewhere?

I have used RubyCLR and ruby-mono[1], but don't know if I still have
any of the old projects sitting around. There is also the Sapphire in
Steel Ruby bridge[2] or perhaps hitting .Net via Win32 COM. I have
some links in my mail archives[3,4,5] but don't know if they still are
alive or useful since my company doesn't allow outbound http anymore.

[1] http://raa.ruby-lang.org/project/ruby-mono/
[2] ...
[3] http://rbazinet.wordpress.com/2006/03/30/rubyclr-ruby-meets-net/
[4] http://www.iunknown.com/articles/tag/rubyclr
[5] http://rubyforge.org/plugins/scmsvn/viewcvs.php/trunk/Samples/?root=rubyclr

Found this snippet:
require 'rubyclr'

RubyClr::reference_file 'Assembly.dll'

include Assembly

connection = DataStoreConnection.new
connection.Open
 
B

brabuhr

I've written quite a bit of logic into DLL's using C#. I would like
to leverage that logic in my Ruby scripts, but I am unsure where to
start or how to start. I've installed RubyClr, but no documentation
installed with it.

Is RubyClr the correct path to take? Where can I find examples?
Should I be looking elsewhere?

I have used RubyCLR and ruby-mono[1], but don't know if I still have
any of the old projects sitting around.

Found an old ruby-mono project while I was cleaning up:

require 'mono'

class RPCClient
def initialize server
@assembly = Mono::loadAssembly( "rpcclient.dll" )
@RPC = @assembly.new "Remoting::Client"
@RPC.Initialize( server )
end

def call rpc_call
@RPC.Call( rpc_call )
end
end

Remoting::Client was a C# class that would send a string request over
a TCP remote channel to a Remoting::Server and return the string
response.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,201
Messages
2,571,049
Members
47,654
Latest member
LannySinge

Latest Threads

Top