c++ - How can I see the output from printf's that are called from a DLL used by a Mex function in Matlab? -


i have mex code calls functions dll. dll has bunch of printf statements scattered around useful debugging. however, cannot see output in matlab command window. i've done reading , apparently because command windows not treated console application output printf can sent. have tried using link's solution no avail. have access source code of dll. compiling windows 7 in visual studio 2010. have tried using cout , works; however, not want rewrite of functions use cout. there can redirect output of printf matlab's command window?

you need call setstdhandle before dll loads , initializes runtime library. can attach write end of pipe, , read other end.

once runtime library initializes, have global data tied original stdout handle, , may not affected future calls setstdhandle.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -