469,649 Members | 1,199 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,649 developers. It's quick & easy.

Mixing .net languages

Tim
Hi

I have a program that I had written in Managed C++ that writes messages to the console while running. I wanted to allow the user to enter commands at the console as well, but this became difficult since the console was continuously being updated with messages. I thought to write a VB front end for the program to have a console-like window (textbox) to display the messages, and a box that will allow the user to enter commands uninterrupted. My problem is mixing the two languages. If I am correct, I can compile the C++ application as a .dll file that gets imported into the VB application for use. But the original program is the one that does the writing to the console - how do I capture that and redirect it to a VB textbox? I thought about setting up a Stream to a textbox, since Managed C++ can work with Streams - but I do not know if this is possible. Any ideas

Thank you
Tim
Nov 20 '05 #1
3 1018
On 2004-01-26, Tim <an*******@discussions.microsoft.com> wrote:
Hi,

I have a program that I had written in Managed C++ that writes messages to the console while running. I wanted to allow the user to enter commands at the console as well, but this became difficult since the console was continuously being updated with messages. I thought to write a VB front end for the program to have a console-like window (textbox) to display the messages, and a box that will allow the user to enter commands uninterrupted. My problem is mixing the two languages. If I am correct, I can compile the C++ application as a .dll file that gets imported into the VB application for use. But the original program is the one that does the writing to the console - how do I capture that and redirect it to a VB textbox? I thought about setting up a Stream to a textbox, since Managed C++ can work with Streams - but I do not know if this is possible. Any ideas?

Thank you,
Tim


Tim,

System.Diagnostics.Process is your friend... You can launch your app
and redirect it's stdout/stdin.

HTH
--
Tom Shelton [MVP]
Nov 20 '05 #2
* Tom Shelton <to*@mtogden.com> scripsit:
I have a program that I had written in Managed C++ that writes
messages to the console while running.


System.Diagnostics.Process is your friend... You can launch your app
and redirect it's stdout/stdin.


Something like that:

<http://www.mvps.org/dotnet/dotnet/samples/miscsamples/downloads/RedirectConsole.zip>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Tim
Thank you both. Now I can get this working ;)

-Tim
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Pierre Rouleau | last post: by
4 posts views Thread by Rudolf | last post: by
2 posts views Thread by Loyd Christmas | last post: by
11 posts views Thread by gg | last post: by
28 posts views Thread by ziman137 | last post: by
3 posts views Thread by jason | last post: by
6 posts views Thread by =?iso-8859-1?B?QW5kcuk=?= | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.