How to access dylib in my VBA code?
-
Monday, February 06, 2012 5:15 AM
I'm searching for accessing my own .dylib in VBA code.
I've tried to access the system lib such as
Private Declare Function rand CDecl Lib "libc.dylib" Alias "rand" ()Sub MyTest()Rem HirandEnd Sub
Although it will crash, I consider it can be successful compiled.
And if I try to access my own dylib such as
Private Declare Function myFunc CDecl Lib "/Users/Me/TestLib.dylib" Alias "myFunc" ()Sub MyTest()Rem HimyFuncEnd Sub
It will occur a compile error as "can not find the path /Users/Me/TestLib.dylib".
Did I make any mistake?
I've try to google it but I can't find any answer. (I've found an answer told me I have to use ":" instead of "/" in the path but it didn't work.)
Thanks for your answer.
All Replies
-
Tuesday, March 06, 2012 7:56 PM
The approach described in the following article does seem to work:
http://delphihaven.wordpress.com/2011/10/17/firemonkey-forms-and-dlls/
The secret seems to be to name the exported function "correctly", with an underscore.
But how you create a function in (say) XCode and Objective-C or C++ on Mac that does the same thing, I don't yet know.
Peter Jamieson

