Ruby 怎么样列出 dll 文件的所有方法和参数

tablecell · December 27, 2015 · Last by seiran replied at December 28, 2015 · 1760 hits

extend FFI::Library 需要将 dll 中的用到的方法和参数用 attach_function 列出来 如果不是自己写的 dll,是系统已经有的 dll 文件,怎么样列出 dll 文件的所有方法和参数

找到 dll 对应的 .h 文件

方法名和参数的话视你具体情况可以用自动推理,比如放在 method_missing 里面,然后参数如果是 Fixnum 就写一个 int,String 就写一个 char *,现场 attach_function

You need to Sign in before reply, if you don't have an account, please Sign up first.