From: RichardOnRails Date: 2011-06-01T04:25:46+09:00 Subject: Re: Problem using 1.8.6 5WinAPI references in 1.9.2 On May 30, 4:05 pm, RichardOnRails wrote: > Hi, > > I wrote a little AlarmClock.rb utility that I like to use from time to > time. I posted the 84-line program athttp://www.pastie.org/1994636. > (No doubt, my code is verbose, but that's not the point here.) > > The require and include statements that I use for 1.8.6 execution are > rejected by 1.9.2.  Googling indicates that WinAPI has been > subordinated to the DL library, > > As the program stands, I get the following under 1.9.2: > AlarmClock.rb:72:in `run': uninitialized constant Alarm::Sound > (NameError) >         from AlarmClock.rb:87:in `
' > > I guessed in lines 19-22 at what requires/includes I might need to get > this app running under 1.9.2.  Being perhaps right in 1 out of 4 > guesses is not a great way to solve my problem. > > Help would be most appreciated, > Richard I apologize for the typo I had in my title for this thread. I thought I had to use the DL (Dynamic Loading Library) for Ruby 1.9 in order to access the WinAPI. However, I couldn't find any good documentation on DL. Today I found FFI, and it seems to have good examples to access the WinAPI. It seems to have a gem for installation also. So maybe I've found a solution to my problem. I'll post back if FII works for me. Best wishes, Richard