Search code examples
c++godllcgo

How to make a callback to GO method from C++ DLL


I have a GO program with a function that make a CGO call to c method defined in a dll. That part works great.. Now i need to make a callback from my dll to GO. Is that possible, any helping pointers ?

Note that my DLL code is separate codebase which gets compiled and linked separately to generate dll using visual studio. I'm on windows 10 64 bit machine.


Solution

  • I found exactly what i was looking for. Posting here so that it may help other with this problem.

    https://github.com/golang/go/wiki/cgo#function-pointer-callbacks