How to use JNA callback

后端 未结 1 1661

I am using JNA to call functions of a dll file.

simpleDLL.h:

typedef int (__stdcall *eventCallback)(unsigned int id, int value);

namespace test
{
   cla         


        
相关标签:
1条回答
  • 2021-01-25 21:00

    C++ is not the same thing as C. Dump the symbols from your DLL (http://dependencywalker.com), and you will see that the function name (at least from the linker's point of view) is not "setCallback".

    Use extern "C" to avoid name mangling on exported functions, rename your Java function to match the exported linker symbol, or use a FunctionMapper to map the Java method name to the linker symbol.

    0 讨论(0)
提交回复
热议问题