On Apr 12, 2007, at 3:27 PM, Daniel Stenning wrote: > I have a need to call C functions using function pointers derived from > Declare calls ( in my case this is to act as a Steinberg VST plugin > host ). > I would really like to do this without having to create a plugin > for this > aspect. > > Assuming existence of global module method globalmethodName(...), I > would > like to be able to do something like: > > Dim fp as Ptr = getmyfuncPointerFromPlugin() > Dim result as Boolean = fp.globalmethodName(... ) > > In order to call the function pointed to by fp with the same > "signature" as > globalmethodName. > > Heres the FR link: > > http://www.realsoftware.com/feedback/viewreport.php?reportid=zxtlyljg
You could use dlopen / dlclose / dlsym to get the pointer and you dont need to do a lot of extra work. But you have no way to call it from within RB. You could write a plugin that would load the dylib and provide an interface to the loaded routine. It's a bit different from the technique in the article I did on RBLibrary about making a plugin api for an app but not to far removed. That article even had full source and projects for OS X, Windows and Linux which you could twist into what you need pretty easily _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
