[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Calling DLL's from Ruby

dkmd_nielsen

9/3/2008 8:16:00 PM

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
7 Answers

brabuhr

9/3/2008 9:15:00 PM

0

On Wed, Sep 3, 2008 at 4:14 PM, dkmd_nielsen <donn@cmscms.com> wrote:
> 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/...
[2] ...
[3] http://rbazinet.wordpress.com/2006/03/30/rubyclr-ruby-...
[4] http://www.iunknown.com/articles/t...
[5] http://rubyforge.org/plugins/scmsvn/viewcvs.php/trunk/Samples/?ro...

Found this snippet:
require 'rubyclr'

RubyClr::reference_file 'Assembly.dll'

include Assembly

connection = DataStoreConnection.new
connection.Open

Roger Pack

9/4/2008 6:02:00 PM

0


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

Have you looked at ruby/dl?
-=R
--
Posted via http://www.ruby-....

brabuhr

9/10/2008 5:40:00 PM

0

On Wed, Sep 3, 2008 at 5:14 PM, <brabuhr@gmail.com> wrote:
> On Wed, Sep 3, 2008 at 4:14 PM, dkmd_nielsen <donn@cmscms.com> wrote:
>> 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.

Luke.Schleusener

10/25/2009 4:21:00 PM

0

On Oct 24, 10:46 pm, "Allen W. McDonnell" <tan...@peakoil.com> wrote:

> Maybe I am just a dull person, but what is so hellish about most of these
> WI's?

Well, there's this bloke named Daniel, he ate a lot of lead paint and
posts alot....

> Other than the war related ones their consequences would all be relatively
> small and local, not broad based and widely impacting.

Uh, surely you're joking. Perhaps we should have a talk about the non-
war related ways that history can change; I know you've been
frustrated by trying to turn Timbuktu into Tuscon, but there's plenty
of other, and frequently better, non war stuf.

> Could Hawaii still be a territory instead of a State?  Sure, it was really
> admitted more as a balance to the admission of Alaska than for any pressing
> need for it to become a state.  

It got admitted because of Pearl Harbor. Unless you're from an
alternate universe where one of those is a slave state.

> Alaska might not have been admitted, or
> conversely some other area could have been admitted instead of Hawaii as the
> counter balance, such as theD.C. or a combination of Puerto Rico and the
> USVI.

DC statehood is unconstitutional. Puerto Rico and the US Virgin
Islands both belong to Insular cases, and are too brown and other to
get statehood. Ah, well.

IIRC, you're Canadian. I understand that it can be a problem to be
from a country with no history, but goin around makin' stuff up about
your awesome neighbor to the south is just stuff and nonsense. C'mon.

Best

L

DJensen

10/25/2009 7:52:00 PM

0

Luke Schleusener wrote:
> IIRC, you're Canadian. I understand that it can be a problem to be
> from a country with no history, but goin around makin' stuff up about
> your awesome neighbor to the south is just stuff and nonsense. C'mon.

I'm glad both trolls in this thread have identified themselves.

--
DJensen

troll

10/26/2009 2:26:00 AM

0

I guess posting to usenet, or also reading it
is often bad news.

I might as well dredge up the Hawaii related
post from the depths. It is near to Halloween
anyway.

< Hellish what-ifs.
<
< ***
<
< What if there was no Captain Cook?
<
< ***
<
< What if there was a Captain Cook that did sail for
< the south seas on several expeditions, but he managed
< to miss the Hawaiian island chain on all of his
< expeditions. Is this very likely?
<
< ***
<
< What if Kamehameha I had not lifted the Naha Stone?
<
< Kamehameha I dies from stray gun fire during
< the Battle of Nuuanu. What effects will this have
< on the history of Hawaii and the world?
<
< ***
<
< What if there was no Ai Noa? Is it feasible that
< Hawaii could have not adopted Christianity over
< the next several decades? Is there any time
< in which Hawaii could have adopted Buddhism
< en masse?
<
< ***
<
< What if Kamehameha II had not visited Great
< Britain in 1824?
<
< ***
<
< What if the United Kingdom had annexed Hawaii
< in 1843? What if France had annexed it in
< 1839 or 1849?
<
< ***
<
< What if there was no Father Damien?
<
< ***
<
< What if there had been no Bayonet Constitution?
< What if there were no Sanford B. Dole, or
< Lorrin A. Thurston? Could the monarchy
< have continued to rule Hawaii throughout
< the 20th century?
<
< ***
<
< What if the United States had not annexed
< Hawaii in 1898? What if there was no
< Spanish-American War?
<
< ***
<
< What if the United States had attempted
< a large scale invasion of Japan in 1942?
< Is there any level of U.S. fleet destruction
< in the Pacific that might have made the
< U.S. consider abandoning Hawaii like it
< did the Philippines during that war?
<
< ***
<
< What if Hawaii did not become a State in
< 1959? Is it feasible that it could still
< remain a territory like Puerto Rico even
< 50 years later?
<
< ***
<
< What if Stanley Armour Dunham and his
< family had never moved to Hawaii? How
< would the history of the world have
< been altered?
<
< ***

http://en.wikipedia.org/wi...

http://en.wikipedia.org/wiki/...

http://en.wikipedia.org/wiki/Ka...

http://en.wikipedia.org/wiki...

http://en.wikipedia.org/wiki...

http://en.wikipedia.org/wiki/Ka...I

http://en.wikipedia.org/wiki/Fat...

http://en.wikipedia.org/wiki/Overthrow_of_the_Kingdom...

http://en.wikipedia.org/wiki/1887_Constitution_of_the_Kingdom...

http://en.wikipedia.org/wiki/Sanfo...

http://en.wikipedia.org/wiki/Lorrin_A...

http://en.wikipedia.org/wiki/Newlands_...

http://en.wikipedia.org/wiki/Joint_...

http://en.wikipedia.org/wiki/Spanish_Am...

http://en.wikipedia.org/wiki/Hawaii_Adm...

http://en.wikipedia.org/wiki/Stanley_Arm...


On Oct 24, 8:46 pm, "Allen W. McDonnell" <tan...@peakoil.com> wrote:

> ...
> but what is so hellish about most of these WI's?
> ...

< The English word that generally refers to the
< island chain starts with the letter 'H', like
< the word 'hell'.
<
< The English word 'kill' also sounds slightly
< like the first syllable of the frequently
< erupting volcano on the big island.
<
< The name 'Cook' also is similar to
< a verb that deals with an action that
< involves the application of heat.
<
< Generally, these are all simply
< Hawaii related what-ifs.

danielsindell444

11/2/2009 10:31:00 PM

0



Luke Schleusener wrote:
> On Oct 24, 10:46 pm, "Allen W. McDonnell" <tan...@peakoil.com> wrote:
>
> > Maybe I am just a dull person, but what is so hellish about most of these
> > WI's?
>
> Well, there's this bloke named Daniel, he ate a lot of lead paint and
> posts alot....
>
L

Luke-

At least Daniel has something between his two ears...All you have is
shit!
Boo--Hoo! I bet little Luke is crying. I hurt his feelings.
Stick it!

-Guess Who

(this is not Daniel- it is someone using his login. Ha! Ha!)