From: Bill Kelly Date: 2005-10-12T09:25:41+09:00 Subject: Re: Ruby/DL Question From: "gregarican" > > Four methods down, 95 to go. Checking the TSAPI docs in detail there > are a lot more items in it than I first thought. A lot more than > 30-something. All of the pointer passing back and forth between the DLL > file and Ruby gets tedious, but at least the Ruby/DL library makes it > easier than the more manual methods in Win32API. Hi, I think you may have mentioned SWIG earlier in the thread - but if you've only taken a brief look at SWIG so far, I'd definitely recommend having another go at it (unless there's a known reason why SWIG can't cope with your particular project.) I did ruby bindings by hand for a few projects. I kept looking at SWIG but somehow didn't "get" it from the documentation - or at least, for whatever reason, everytime I downloaded SWIG and started trying to figure out how to use it, I ended up thinking, heck I'd be half-done if I wrote the bindings by hand by now, and ended up putting off learning SWIG. I finally forced myself to learn SWIG doing the bindings for ruby-ftgl ( http://rubyforge.org/projects/ruby-ftgl/ ) It was worth it. You pretty much just give SWIG the function declarations from the the library you're trying to wrap, and the bindings magically appear. Some tweaks can be needed, such as functions which return values through paramters - but SWIG can handle that, it just needs some simple hints. You can point SWIG at the actual header files from the library, but it may end up trying to wrap more stuff than you really wanted. So you can just copy the function declarations from the library header file(s) you're interested in, and turn SWIG loose on those. (Which is good, because you may need to mark up a few of the declarations slightly, to provide the hints alluded to above.) Anyway just wanted to give some props to SWIG in case you might be at the same point I was for awhile where SWIG seemed to weird and complicated to bother with. It's pretty neat. Regards, Bill