From: Patrick Hurley Date: 2006-05-12T21:21:02+09:00 Subject: Re: Ruby and windows. On 5/12/06, Tim Uckun wrote: > Thanks. I am a bit disapointed that I can't write activex controls or > DLLs in ruby, I know it's possible to do that in python. > > I will take a look at the windows service though, that might provide a > workaround for some of the stuff I want to do. > > On 5/12/06, Dave Burt wrote: > > Tim Uckun wrote: > > > I want to convert a series of VB DLLs to ruby. Is it possible to write > > > activex controls and DLLs in ruby? There might be a snag in that the > > > controls need to send events to the calling program. > > > > The short answer is no, you can't compile Ruby code into a binary DLL. > > You can call DLLs from Ruby. > > > > The slightly longer answer involves Ruby2C, which converts a subset of > > Ruby to C, but I don't suppose this is what you want. > > > > > Also is it possible to write windows servers in ruby or have ruby > > > itself run as a windows service? > > > > Yes, you can do these. Check out win32-service on the RAA. > > > > Cheers, > > > > Dave > > > > > Well a more complete answer would be that you cannot write a DLL in just Ruby. It is pretty easy to embed Ruby into a C program (or DLL) and then have it wrap either an embedded or external Ruby program. Do be careful that the Ruby interpreter is not thread safe and if you need to support threads you should mutex the whole thing. Good luck pth