I need help with binding error

LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.

Moderators: LCMark, LCfraser

Post Reply
jpags.me
Posts: 8
Joined: Thu Jan 31, 2019 7:42 am

I need help with binding error

Post by jpags.me » Thu Mar 14, 2019 4:31 am

I have created a LiveCode builder that calls a function from a DLL file. I was able to successfully create the extension but then when I tried using the extension it produces an error "Unable to bind foreign handler test_new_lcb.Multiply_numbers" . My DLL file only returns a multiplied number or does only multiplication.

Can someone help me with this? What did I do wrong on my code? Thank you

This is my LCB file.

Code: Select all

library test_new_lcb

use com.livecode.engine
use com.livecode.foreign

foreign handler Multiply_numbers(in pNum1 as CInt, in pNum2 as CInt) returns CInt binds to "new_dll>multiply_numbers"


public handler testing_num(in p1,in p2) returns CInt
  
  unsafe
  
      return Multiply_numbers(p1,p2)
      
  end unsafe
  
end handler

end library

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: I need help with binding error

Post by PaulDaMacMan » Thu Mar 14, 2019 10:44 pm

try adding the language indicator part of the binding string:
"c:new_dll>multiply_numbers" -- c is for C language
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

jpags.me
Posts: 8
Joined: Thu Jan 31, 2019 7:42 am

Re: I need help with binding error

Post by jpags.me » Fri Mar 15, 2019 2:27 am

I have created a C# DLL. Is that not supported? How can I bind a C# dll file?

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: I need help with binding error

Post by PaulDaMacMan » Fri Mar 15, 2019 9:51 pm

jpags.me wrote:
Fri Mar 15, 2019 2:27 am
I have created a C# DLL. Is that not supported? How can I bind a C# dll file?
I'm not sure if C# is supported.
I know for sure that regular C, C++, Objective C, and Java are supported.

I think the FFI binding is based on this here (but I could be wrong):
https://github.com/libffi/libffi
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

Post Reply

Return to “LiveCode Builder”