calling external c# functions with "ref" keyword

59 views
Skip to first unread message

oleg karasev

unread,
Oct 28, 2013, 5:14:00 PM10/28/13
to haxe...@googlegroups.com
I want to call external c# function from haxe

public static void TestExternal(ref int)

the problem is in "ref" c# keyword.  If I write in haxe:

1)TestExternal(value) - it causes error "no ref keyword"
2)TestExternal(untyped __cs__("ref ") value) - it causes error "unexpected "value"

any ideas?

Dan Korostelev

unread,
Oct 28, 2013, 5:39:46 PM10/28/13
to haxe...@googlegroups.com
IIRC, when you define extern, use cs.Ref<Int> as argument type.

вторник, 29 октября 2013 г., 1:14:00 UTC+4 пользователь oleg karasev написал:

Cauê Waneck

unread,
Oct 28, 2013, 5:41:34 PM10/28/13
to haxe...@googlegroups.com
You can define the extern with the cs.Ref<> type:

static function TestExternal(int:cs.Ref<Int>):Void

Be aware that ref support is a little experimental - let me know if it works for you!


2013/10/28 oleg karasev <okar...@gmail.com>

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/groups/opt_out.

oleg karasev

unread,
Oct 29, 2013, 1:51:35 AM10/29/13
to haxe...@googlegroups.com
It works! Thanks a lot!
Reply all
Reply to author
Forward
0 new messages