-
Yes, actually, it does throw an exception. It is however a "java.io.IOException" because the C++ program is interfacing with the Java classes that in turn interface with the device. I don't know how specificially but I know that they do. My C++ program cannot catch a java exception. A horrifying nightmare caused by people who refuse to accept the fact that there are multiple programming languages out there...not just java
-
Well this certainly puts a whole new spin on this advice: "Don't allow exceptions to propagate across module/subsystem boundaries" ;)
BTW, Java has something called JNI (Java Native Interface) that allows communication between native code and Java classes. I've never used it though, so you'll have to look it up yourself.
I'd recommend fixing the 'driver' by writing a Java adapter around all the public functions that catches & translates any exceptions that are thrown into standard C error codes... Then your C++ code don't need to worry about exceptions anymore.