java - Reading output of a C++ DLL using JNA -


i have following "system":

c++ dll -> c dll -> java jna

the c++ dll third party dll, wanted use java using jna. jna works better c c++, made c wrapper load c++ dll (using loadlibrary), in java, jna, load c dll , access functions exported c wrapper.

i guess there may better design work c++ dll in java, not point here, , seems work.

my problem c++ dll writes on stdout , stderr, messages written c++ dll not displayed in java console, though messages written c wrapper displayed. solution read output of c++ dll java ?

so far tried make "test wrapper" in c++, directly loads c++ dll using loadlibrary , use functions, output of c++ dll displayed correctly.

then tried call freopen() redirect stdout file c wrapper. when using "test wrapper", output of c++ dll redirect file, when calling c wrapper jna, output of c wrapper , of java redirected file (output of c++ dll ignored).

the c++ dll compiled msvc 2013, , c dll wrapper too. working windows 7.


Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -