การ include library ใน ruby ทำยังไง?

  • warning: realpath() [function.realpath]: SAFE MODE Restriction in effect. The script whose uid is 1005 is not allowed to access /tmp owned by uid 0 in /var/www/sites/sugree/codenone.com/subdomains/www/html/includes/file.inc on line 190.
  • warning: realpath() [function.realpath]: SAFE MODE Restriction in effect. The script whose uid is 1005 is not allowed to access /tmp owned by uid 0 in /var/www/sites/sugree/codenone.com/subdomains/www/html/includes/file.inc on line 190.

คือผมเคยเขียน include inpout32.dll ใน vb และหาข้อมูลก็เจอของพวก delphi
แต่ผมอยากลองเขียนใน ruby ไม่รู้ต้องincludeยังไง
และ declare เพื่อเรียกใช้งานยังไง

หมายถึงอันนี้หรือเปล่า
http://www.mustap.com/rubyzone_post_90_ruby-on-windows

เอกสาร
http://www.ruby-doc.org/stdlib/libdoc/Win32API/rdoc/index.html

#รูปแบบ

 require 'Win32API'
yourAPIVariable = Win32API.new("dllname","functionFromDll","[parameters]","returntype")
yourAPIVariable.call(*parameters)

#ตัวอย่าง

require "Win32API"
# WinAPI
Inpbyte=Win32API.new("inpout32.dll","Inp32",["l"],"l")
Inbyte.call(0x378)&0xff

(ไม่รู้ใช้ได้ป่ะ ??)

ขอบคุณครับ แล้วจะลองดูครับ

ย้าย Codenone

ประกาศย้าย Codenone ไปใช้ Forum ของ Blognone แทนครับ ตามไปตั้งกระทู้ต่อได้ที่ Codenone Forum (รายละเอียดอ่านจากกระทู้ ย้าย Codenone ไปรวมกับ Blognone)

กระทู้เก่าๆ จะย้ายตามไปในภายหลัง ตอนนี้ปิดการโพสต์กระทู้ไว้ เหลือไว้เฉพาะอ้างอิงเท่านั้น