473,804 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1153
On 2004-01-26, Tim <an*******@disc ussions.microso ft.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.Diagnost ics.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.co m> scripsit:
I have a program that I had written in Managed C++ that writes
messages to the console while running.


System.Diagnost ics.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
2645
by: Pierre Rouleau | last post by:
I have a problem writing self-testable modules using doctest when these modules have internationalized strings using gettext _('...'). - The main module of an application (say app.py) calls gettext.install() to install the special _ function inside Python builtin. Other modules, taken from a general purpose collection of Python modules, also support internationalisation and doctest testing. For example:
4
23692
by: Rudolf | last post by:
Is it possible to add a vb.net source code module to a c# project and if so how? Thanks Rudolf
2
1112
by: Loyd Christmas | last post by:
As a non-techie, I am curious if my developers can mix VB.Net and C# in the same project and be OK. Seems to be some disagreement here.
11
1504
by: gg | last post by:
Hi, I'm sure this must be one of the most popular questions... I've developed the application in VB and have some C# code which I want to incorporate. Visual Studio seems to allow you either a VB or C# project, neither of which can contain files from the other language. The official method of combining languages is to create two projects under the same solution, one for the VB code, one for the C# code. This seems pants.
7
1502
by: BK | last post by:
I have a .NET project named FormattedOuput with output type set to Class Library. In it, I have a source file named ExcelOutput.Vb. This class produces an Excel object and manipulates it based on some input I provide. It works fine and has been fully tested. Meanwhile, another programmer was writing a source file named RTFOutput.Cs, a C Sharpt program that does similiar work for RTF file output. He has fully tested his source and it...
28
3107
by: ziman137 | last post by:
Hello all, I have a question and am seeking for some advice. I am currently working to implement an algorithmic library. Because the performance is the most important factor in later applications, I decide to write it in C instead of C++. However, I thought it might be convenient to use some C++ code at some misc places. I'm aware that, I could always use the C++ compiler to get it work.
3
2101
by: jason | last post by:
I've been working with C# for over a year now without touching vb.net code. I had a few light years of vb.net before that. No real vb6 or windows form experience. Suddenly, I have an assignment where I've been asked to create a few new pages on an exsisting website. The website is written in vb.net with vb.net codebehind and classes. My employer says I can use C# for new stuff If I want.
2
1069
by: Newbie19 | last post by:
I was wondering what is the best concept or idea to mixing visual basic with ASP.net page that runs a SQL query on a database. The Visual Basic would be pulling data from another source that is not a database and needs to place the data results along with the SQL Query results. Any advice would be helpful. Thanks.
6
2043
by: =?iso-8859-1?B?QW5kcuk=?= | last post by:
I've encountered a problem using gettext with properties while using a Python interpreter. Here's a simple program that illustrate the problem. ============== # i18n_test.py: test of gettext & properties import gettext fr = gettext.translation('i18n_test', './translations',
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10604
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10359
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10101
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9177
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6870
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3837
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3005
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.