Jump to content
Excelsior Forums


  • Content count

  • Joined

  • Last visited


Everything posted by rfrowd

  1. I am trying to use xfunction to interface from Java to a C DLL in MS Windows. The function I am trying to call returns a pointer to a class. In C: typedef void *HPROB; #define SOLVAPI extern "C" __declspec(dllexport) SOLVAPI HPROB CoinCreateProblem(char *ProblemName); I need to return this HPROB pointer to pass to the next call to the dll. Can I just use a long variable type for this? In Java: xFunction create = new xFunction("CoinMP", "long CoinCreateProblem(CSTRING)"); Then to extract the return value: Argument arg1 = new Argument("CSS Problem", Argument.CSTRING); long hprob = (Long) create.invoke(arg1); Then to pass it to the next function in the dll call: args[0] = new Argument(hprob);