LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Output text & variables to standard CVI IO window from within C++ DLL

Hello all,

I am stuck with the following problem:

I call a C++ DLL (created in VC++ 6.0) from LabWindows/CVI. This works
just fine (i.e., it does all the functions on variables I would expect
from it).

Now I would like to let the C++ DLL output text & variables to the
standard I/O DOS window used by LabWindows/CVI...

When I use the PRINTF() statement in the source code for the DLL,
nothing happens on the output screen.

So, can anyone please tell me how to do this ??

I asked support from an NI engineer, but this is what I got:

>>Hello,
>>Please check out this link:

http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/1839fe5bc8
f6723086256951004ed5b9?OpenDocument

>>Have a nice day.

P
retty useless!!

So, if any of you could give some _real_ advice, this would be greatly
appreciated.

Thanks a lot,
Gunter
0 Kudos
Message 1 of 2
(3,003 Views)
Hello

Looks like there might be some difference in the implementation of the way the CVI RTE handles the console, as compared to MSVCRTE. The dll might be depending on the MSVCRTE to allocate the console resources for it.
A way around this would be to make sure that dll gets its console resources assigned to itself, hence not depending on the run-time calling the dll to do it. I have attached the files for a function called RedirectIOToConsole() which does this. You can place this function in your dll, and recompile it. Check out this link for more information about this function. I tried it, and it seemed to do the trick.

I hope this helps

Thanks

Bilal Durrani
NI
Bilal Durrani
NI
Download All
0 Kudos
Message 2 of 2
(3,003 Views)