Forum: Ruby Hosting Ruby in C#

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
61445924816c0130be8867ef28a0c5fe?d=identicon&s=25 Durgaprasad Gorti (Guest)
on 2009-06-08 06:51
(Received via mailing list)
Folks,

I am trying to integrate Ruby into a C# app.

For this, I am trying to use the .NET interop.



It looks like the dll I would like use (On windows Platform)
is the msvcrt-ruby18.dll.



The dll above seems to export routines with _ prefix
such as _rub_init(). So technically I could do

A [dllimport and use _ruby_init ] as the function to call.





To verify my theory, I looked at the ruby.h and I was hoping

To find an ifdef that defines ruby_init (without the underscore) to
_ruby_init (with underscore)
I can't find such a thing.



So my question here is if I am trying to load the msvcrt-ruby18.dll and
call
functions
from the dll, should/could I call these functions with leading
underscores?



Thanks for your help.

Durgaprasad Gorti

http://blogs.msdn.com/dgorti
68a08995ddf9b3f8a0b562ed0baf63af?d=identicon&s=25 Michael Bruschkewitz (Guest)
on 2009-06-10 09:45
(Received via mailing list)
"Durgaprasad Gorti" <dgorti@msn.com> schrieb im Newsbeitrag
news:BLU128-DS296F076725CF89FE0D7A1C6470@phx.gbl...
> To find an ifdef that defines ruby_init (without the underscore) to
> _ruby_init (with underscore)
> I can't find such a thing.

The "_" is automatically added when functions are compiled using
"C"-linkage. This is done by the compiler w/o preprocessor affected.

> So my question here is if I am trying to load the msvcrt-ruby18.dll and
> call
> functions
> from the dll, should/could I call these functions with leading
> underscores?

IMHO, no.
Why you did not just try it?

Regards,
Michael B.
7956c3c7d7ef344265029e6b4b569b91?d=identicon&s=25 Huw Collingbourne (huw)
on 2009-06-10 13:04
Durgaprasad Gorti wrote:
> Folks,
>
> I am trying to integrate Ruby into a C# app.
>
>

You may want to try our (free) Ruby Connector:

http://www.sapphiresteel.com/SapphireSteel-Downloads

best wishes
Huw

SapphireSteel Software
http://www.sapphiresteel.com
This topic is locked and can not be replied to.