Problem using 1.8.6 5WinAPI references in 1.9.2

R

RichardOnRails

Hi,

I wrote a little AlarmClock.rb utility that I like to use from time to
time. I posted the 84-line program at http://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 `<main>'

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
 
R

RichardOnRails

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 `<main>'

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,054
Latest member
LucyCarper

Latest Threads

Top