Subject: Re: [ruby-ffi] Re: lists only one lib? |
From: Luis Lavena |
Date: 12/21/09 9:59 AM |
To: ruby-ffi@googlegroups.com |
On Mon, Dec 21, 2009 at 11:03 AM, rogerdpack <rogerpack2005@gmail.com> wrote:
ffi_lib 'user32', 'msvcrt'
Hmm. This code: require 'ffi' module M extend FFI::Library ffi_lib 'user32' ffi_lib 'msvcrt' attach_function 'FindWindow', [ :string, :string], :pointer end yields this response: C:/installs/ruby19_mingw/lib/ruby/gems/1.9.1/gems/ffi-0.5.4-x86- mingw32/lib/ffi/library.rb:77:in `attach_function': Function 'FindWindow' not found in [msvcrt] (FFI::NotFoundError) from go2.rb:6:in `<module:M>' from go2.rb:2:in `<main>' I assume this is unexpected?
Roger, for the sake of my mental health, would you mind put a sample that indeed works? Wayne already answered to you that ffi_lib takes an array, multiple invocations to append are not possible. If you believe that could be improved, send a patch. Also, when using functions, try put the indication to a true function, which in the case of FindWindow, as discussed before, do not exist.-- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exupéry