Marek
Marek

Reputation: 11

JNA - output parameter in DLL

How can I get the output parameter, which is in a method in a C++ DLL?

public class MyClass {

    public int error = 0;

    public String MyMethod(){
        String str = null;

        error = error(str);

        if (error == 0){
            return str;
        }
        else
            return null;
    }

    public native int error(String outputparam);

    static {
        Native.register("MyDLL");
    }
}

Upvotes: 0

Views: 1669

Answers (1)

technomage
technomage

Reputation: 10069

See this JNA FAQ entry, which explains how to extract a "returned" string from a buffer used as a parameter.

Upvotes: 1

Related Questions