wrapper dll

Monkey Forums/Monkey Programming/wrapper dll

Alienforce(Posted 2013) [#1]
Could anybody give me a push in the right direction for writing a wrapper for DLL´s in monkey, please ? ... Is there any examples, doc, tutorials etc ??


AdamRedwoods(Posted 2013) [#2]
you'd have to write a separate cpp file with all the appropriate interfaces for the dll.

each class, function, or field would have to be controlled somehow by that cpp file you write, so it then can be extern'ed by monkey.

you also have to keep in mind that monkey uses a garbage collector, so you'd either have to: a) pass only immediate values between monkey and the cpp file or b) create intermediate classes that extend monkey's "object" class.

one example is my wxMonkey bindings on github. in the monkey.cpp file you can see how i create intermediate classes to bridge monkey and wxwidgets.
https://github.com/adamredwoods/wxMonkey/blob/master/wxmonkey/wxmonkey.cpp


Alienforce(Posted 2013) [#3]
Thanks! It should get me started.