Im using Java (JNA) to use a function in a third party .dll file. The functions I'm calling are returing the integer value 1.
After reading, I've discovered that this return value is traditionally 0 if everything runs correctly.
Was wondering if this is always the case or if theres any way to determine what it should be?
In the .h file bundled with the .dll it has the comment
// rc: EXIT_SUCCESS means NO ERROR
After the function.
preguntado el 01 de febrero de 12 a las 14:02
Check actual dll documentation, there should be the way to tell what's wrong. If nothing helps try calling GetLastError() WinAPI - some meaningful error code might be reported. Also try to look at debug output during function call - some traces might be there even in Release build
Yes, zero typically means success in the C/C++ world.
In the days before exception handling you had to have a way to indicate failure and the return value was pretty much reserved for failure/success. As for what '1' means, you will have to look in the header of the dll for the function that is returning '1' and see if they included anything about error conditions. There are too many possibilities without seeing the code or knowing more about the dll to provide any easy answers.
What is the name of the function? What is it attempting to do? What can you do if you know the function failed?