LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I write to CVI Stardard Input/Output window from DLL?

LabWindows 7.1
TestStand 3.1
MSVC++ 6.0

I have in the past printed to the CVI stdio window from an MSVC++ DLL
called from a CVI console application.

Currently, I have a CVI DLL that is called from TestStand. The CVI
DLL in turn calls into a DLL built using MSVC++ 6.0 (i.e.
TestStand --> CVI DLL --> MSVC DLL). I can't seem to be able to print
to the CVI Standard Input/Output window from the MSVC++ 6.0 DLL.

I can printf to the CVI Standard Input/Output window from the CVI DLL,
but all the printfs in my MSVC++ 6.0 DLL result in nothing.

I have tried telling CVI to use both the CVI Standard Input/Output
window and a console window, but the results are the same. I have
tried printing to both stdout and stderr in the
MSVC DLL, but still
nothing.

Is there any way for me to send output to the CVI Standard
Input/Output window (or CVI's console window) from an MSVC++ DLL
called from a CVI DLL when the 'parent' application is NOT a console
application?

---
Bob
0 Kudos
Message 1 of 3
(3,523 Views)
Hell Bob,

I found another discussion forum post which might resolve this issue.

" 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. "


There are two files attached to the post which you can find here:
http://forums.ni.com/ni/board/message?board.id=180&message.id=5902&query.id=6238#M5902


Thanks!
Wendy L
LabWindows/CVI Developer Newsletter
Message 2 of 3
(3,510 Views)
Wendy,

Thanks! I'll give this a try.

---
Bob


0 Kudos
Message 3 of 3
(3,473 Views)