yes. you need to setup a callback in C++ using function pointers. you can have pointers to type functions or regular functions but not methods. i couldnt explain it any better than this post:
Pass BM function pointers to C/C++ code
Pass BM function pointers to C/C++ code