I have a Java program that calls C ++, a program for authenticating users. I would like the program to return either true or false, and if false, update the pointer to the variable of the error message that I can then extract from the Java program.
Another explanation:
The native method will look something like this:
public native String takeInfo(String nt_domain, String nt_id, String nt_idca, String nt_password, String &error);
I would call this method here:
boolean canLogin = takeInfo(domain, userID, "", userPass, String &error)
Then in my C ++ program I would check if the user will be authenticated and save it in a logical state, and then, if false, get an error message and update the error with it. Then return this boolean to my Java program, where I can display the error or allow the user to execute.
Any ideas?
Initially, I had this, so the program would return either "true" or an error message like jstring, but my boss would like, as described above.
source
share