• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

Win32API or DL library usage?

Scheduled Pinned Locked Moved Developers' Forum
7 Posts 3 Posters 966 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    david.
    last edited by 17 Jan 2012, 17:11

    In the context of SU8, with Ruby 1.8.6, i386-mswin32:

    Has anyone got any tips on using the Win32API library? Or, since Win32API is deprecated, preferably the DL library?

    I get errors when trying to

    require 'dl'
    

    or

    require 'Win32API'
    

    .

    At a minimum, I presume I would have to have a local version of Ruby 1.8.6 installed to point to these libraries just to load them. Anyone have some references that shows how this might be loaded and usage examples? TIA.

    1 Reply Last reply Reply Quote 0
    • A Offline
      Anton_S
      last edited by 17 Jan 2012, 19:08

      Well you have to copy the win32API.so to plugins, or requre it by full path.

      1 Reply Last reply Reply Quote 0
      • D Offline
        david.
        last edited by 18 Jan 2012, 16:00

        I was able to get things working with Win32API.

        However, the DL library usage is so poorly documented that I couldn't get it working. The example given in http://forums.sketchucation.com/viewtopic.php?f=180&t=16574 by CPhillips seems incomplete.

        1 Reply Last reply Reply Quote 0
        • D Offline
          Dan Rathbun
          last edited by 18 Jan 2012, 17:53

          @david. said:

          The example given in http://forums.sketchucation.com/viewtopic.php?f=180&t=16574 by CPhillips seems incomplete.

          He has an error in the example, which was noted further down the thread.

          You have to type the DLL functions as they are casewise (in C) in the extern call, but then the DL library creates a "Rubyish" method that has the first char downcased.

          I'm not here much anymore.

          1 Reply Last reply Reply Quote 0
          • D Offline
            david.
            last edited by 18 Jan 2012, 19:02

            OK, got DL working. I misunderstood the comment about case. Thanks!

            1 Reply Last reply Reply Quote 0
            • D Offline
              Dan Rathbun
              last edited by 18 Jan 2012, 21:59

              @david. said:

              However, the DL library usage is so poorly documented that I couldn't get it working.

              The doc for DL is located in the source package, at:

              ruby-1.8.6-p287\ext\dl\doc\dl.txt

              Here's a copy so you need not download the whole source package:
              dl.txt
              Online version at ruby-doc.org

              I'm not here much anymore.

              1 Reply Last reply Reply Quote 0
              • D Offline
                Dan Rathbun
                last edited by 21 Jan 2012, 20:03

                • Ruby (v1.8.6-p287) Windows One-Click Installer (offsite)

                • Helper script: Ruby LOAD PATHs script (Win32) : ver 3.0.1

                • Topic: Win32API vs DL lib

                • Files: Win32API and Win32OLE so files

                I'm not here much anymore.

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                1 / 1
                • First post
                  1/7
                  Last post
                Buy SketchPlus
                Buy SUbD
                Buy WrapR
                Buy eBook
                Buy Modelur
                Buy Vertex Tools
                Buy SketchCuisine
                Buy FormFonts

                Advertisement