Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Binding Project: Handling ref string parameters on delegates used for call backs

$
0
0

Hi all,

I am having to consume a third party library that exposes a single method but relies on me implementing a set of functions that it can then call back to.

So following the documentation for binding projects, I have created the wrapped call in the ApiDefinition, and defined a delegate that would handle the call back.

The API for the call looks like this:

void someFunction(struct parameter *, int (*)(void));

And the binding code:

public delegate void callback(NSObject obj, ref string message);

[BaseType (typeof(NSObject))[
public interface MyAPIWrapper
{
     [static, Export("someFunction:callback:")]
     void someFunction(someStruct param1, callback callMe);

}

This compiles in the .Net world, but when compiled to Native, it returns:

btouch: Do not know how to make a trampoline for System,String& message (BI1001)

I don't control the library I need to call, so I am hoping someone can help me resolve this. If I remove the ref, it links properly, but that obviously doesn't help me.

Cheers all


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>