[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: Ruby Extension/DLL Help

Andy Pelzer

11/17/2003 11:09:00 PM

Hi,

>> In the end, I had to create the DLL using MS Visual C++ and put the
DLL in c:\winnt\systems (or c:\windows
>> \system).
Since i don't have MSVC i couldn't test it your way. So i tried with
MinGW (which is delivered with Dev-C++), but couldn't manage to get my
extension compiled. Have to "investigate" a bit (-> read manual *g*),
seems MinGW doesn't accept include-paths with -I on command line??

>> I think there is an issue with cygwin on XP. I am not sure if the
issue is with cygwin or XP.
Are you sure about the CygWin<->XP issue? I have another extension (not
using an additional/external dll), which compiles fine and also works
with Ruby under CygWin/XP (found an extension-example here:
http://www.bagley.org/~doug/shootout/compare/binext/ruby... ->
working!).

>> Once this was done, I used win32api to successfully access functions
in the library.
Why use Win32api to access the dll's functions? I have a dll-library,
provided by somebody else - no code available to me, so i wrote simple
"access-functions" in c, as an extension for Ruby. Am i mistaking
something here?

Anyways, thanks again, i'll keep on trying [ though not much time for it
;( ]

Greets

Andy


1 Answer

Michael Davis

11/18/2003 3:51:00 AM

0

See comments below...

Andy Pelzer wrote:

> Hi,
>
>
>>>In the end, I had to create the DLL using MS Visual C++ and put the
>
> DLL in c:\winnt\systems (or c:\windows
>
>>>\system).
>
> Since i don't have MSVC i couldn't test it your way. So i tried with
> MinGW (which is delivered with Dev-C++), but couldn't manage to get my
> extension compiled. Have to "investigate" a bit (-> read manual *g*),
> seems MinGW doesn't accept include-paths with -I on command line??

Bummer.

>
>
>>>I think there is an issue with cygwin on XP. I am not sure if the
>
> issue is with cygwin or XP.
> Are you sure about the CygWin<->XP issue? I have another extension (not
> using an additional/external dll), which compiles fine and also works
> with Ruby under CygWin/XP (found an extension-example here:
> http://www.bagley.org/~doug/shootout/compare/binext/ruby... ->
> working!).

No, I am not sure. I bailed on trying to figure out where the error was occurring after a few hours of debugging and opted for a different approach. It could have been a compiler setting or an include path for the libraries.

>
>
>>>Once this was done, I used win32api to successfully access functions
>
> in the library.
> Why use Win32api to access the dll's functions? I have a dll-library,
> provided by somebody else - no code available to me, so i wrote simple
> "access-functions" in c, as an extension for Ruby. Am i mistaking
> something here?

I used Win32api to eliminate the need to write a C wrapper for the DLL functions I wanted to use. The C wrapper may have performed a little better but would have required a little more work on my part. One of my goals was to eliminate the need to compile any C code.

>
> Anyways, thanks again, i'll keep on trying [ though not much time for it
> ;( ]
>
> Greets
>
> Andy
>
>
>
>

See comments above...

Thanks, Michael