How to call Windows DLL from Ruby?

What is the easiest way to use a custom DLL from Ruby?

In Python, I would use ctypes as described in this. But now, how do I do this in Ruby, preferably using my own functions on third-party libraries? Is there a way for Ruby to be as simple as Python to manage a DLL?

Thanks o /

+4
source share
2 answers
+1
source

See the dl module in the standard library . Its not brilliantly documented, but the example there should point you in the right direction.

Ruby used the Win32API module for use on Windows, but which is now deprecated , so you should just use dl directly.

0
source

Source: https://habr.com/ru/post/1444603/


All Articles