Re: Screenshot of app status
Posted: Thu Aug 27, 2020 3:28 pm
.
DSP Robotics and FlowStone Graphical Programming Software Support and Forums
https://dsprobotics.com/support/
Yes, but there's a caveat! The Ruby library for it (Win32API) only works within FlowStone or within exported exe's - but not in VST plugins (a compromise so that the Ruby interpreter is available without requiring an external file). The library also has a reputation for being very tricky to use (you have use Strings as containers for binary data - e.g. Structs - and so on). Having made a few simple things with it myself, I certainly wouldn't recommend it to beginners of either Ruby or FlowStone.MichaelBenjamin wrote:does that mean that that you can link to external dlls as long as they only use the win32 api
In principle, yes, a Ruby "C-extension" compiled in Virtual Studio can define new Ruby methods which wrap functions of other DLLs and wrap their arguments/returns in Ruby objects. The C++ API for bulding extensions is open-source, AFAIK. IIRC, somebody did once re-compile the Ruby "standard libraries" with VS, but it was a long time ago and I couldn't find the thread when I tried searching.MichaelBenjamin wrote:so you can compile a gem in c using vs and link that like a dll?
Yes, there are some other steps to take. But first, for all things related to Ruby I highly recommend to refer to chapter 8 of the Flowstone User Guide. You will need it often, so download the guide and have it open, whenever you program in Ruby.MicheleANE wrote:On the extensions subject:
I tried using CSV ruby library (took it from ruby 1.8 installation because the newer ones are not pure ruby) putting the rb file inside the library folder of FS. Now I can use require inside a ruby component to use its functions and it works well also in focus mode. Though, when I tried making an exe of the app, it seems it doesn't work anymore.
Is there some setting I have to change to include it in the exe? Or is there some other step I have to take?
Best regards
Michele
To assure that, the best practice is to create a folder on the same layer as your executable/fsm, and place the content of the gem inside. Then reference this folder when using "require", for exampleIf you decide to export your creation and it uses a gem then you need to distribute the gem alongside it. You must also make sure that the paths to the gem are all taken care of or it won't load.
Code: Select all
require_relative 'gem_content_folder/gem_file'Code: Select all
require './gem_content_folder/gem_fileWell done! Yes, an absolute path (full path) will always work with require. If you share your executable, make sure the others also have the gem at the same location. (That last bit was why I tried to install a relative path)MicheleANE wrote:Thank you so much Tulamide, you are my new hero.
I tried with the require_relative way but it gave me "can't infer path" error, so I create a new folder in c:/ and placed the gem there, then I used require 'c://fsgems/csv.rb' and it worked well also in the exe run.
Best regards