473,624 Members | 2,135 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to redirect the ouput from the windows console to vc++ ouput window

pri
i need to run a command line tool by clicking on an add in toolbar button.i have tried it using ShellExecute & CreateProcess methods.But both open up the default console window.Is there any way in which I can redirect the output from the console to the output window in vc++?Or maybe im not using the correct methods.Any suggestions please?

From http://developmentnow.com/g/42_2004_...nguages-vc.htm

Posted via DevelopmentNow. com Groups
http://www.developmentnow.com
Mar 10 '06 #1
1 1978
>i need to run a command line tool by clicking on an add in toolbar button.i
have tried it using ShellExecute CreateProcess methods.But both open up the
default console window.Is there any way in which I can redirect the output
from the console to the output window in vc++?Or maybe im not using the
correct methods.Any suggestions please?


search for 'console redirect' on www.codeproject.com
there are plenty of examples on how to do this in C++.

If you are using C++/CLI you can also use the .NET class 'Process' which has
easy to use methods for redirecting the input, output and error streams of a
console application.

If you don't want the console windows itself you have to run it hidden. in
..NET you can do this by configuring Process.StartIn fo. in native you can do
something similar. I believe one of the codeproject articles explains this.

--

Kind regards,
Bruno.
br************* *********@hotma il.com
Remove only "_nos_pam"
Mar 10 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
21053
by: Omid | last post by:
Hi. I have problems when I try to redirect everything that is sent to cout to a file. I have one piece of code that works and one that does not work. The only difference is which headers I use. What the code does: * First writes "This is sent to prompt" to prompt.
2
1892
by: Jason | last post by:
Hello, I have a class, transCore, that does certain work, and by default, prints its progress to the stand output. Later, I will to write a GUI class that encapsulate the transCore class. I would like to redirect/intercept the output of transCore class to this GUI class. I wrote a sample program that demonstrate how I did it, but I am not sure if it's any good. Can anyone critic my code? If there's any non-standard conforming code or...
7
1800
by: MuZZy | last post by:
HI I just wonder if someone can help me with this: I have a windows app project developed on VC++ 6.0. I need to adapt it to be able to compile as a console app as well (So it would call main() instead of WinMain()) I created a new profile for the project and replaced precompile define _WINDOWS by _CONSOLE, and changed linker option /subsystem:windows to /subsystem:console.
4
8734
by: Bill Cohagan | last post by:
I'm writing a console app (in C#) and I want to be able to redirect the standard input/output streams when it's run at a command prompt. IOW I want to support the "<" and ">" redirection syntax. The obvious way to do this is by using the static Console type properties, In and Out. When trying to debug the app in the IDE however, this doesn't appear to work. I've edited the project properties and added the necessary text to the "command...
1
1745
by: Alucard | last post by:
hello all, how do i do a redirection of ouput from a console process to some textbox? For example, in Visual Studio, when you build a solution, the console output from the compiler (another process) is redirected to the Visual Studio's own window.
2
3970
by: booker | last post by:
Hi, As i known,all the c++ compiler under windows platform are of console application. I'm really curious why when they are called by their native IDE(borland c++ ide,visuall c++ ide etc),their console window will not popup and their text ouput is redirect to the ouput window of the IDE.How can they do that? Can anybody tell me?
2
4867
by: Schorschi | last post by:
Ok, I have my own console class that lets me allocate a console, free it, etc. in my windows vb .net application, hell it even hides the cursor, set colors, etc. But the one thing I want to do is redirect the standard console class text from the 'output' in the VS IDE to my console window during debug sessions, when not debugging, everything works fine... so how do I get VS IDE to use my window not 'output'? Thx.
5
1498
by: vedrandekovic | last post by:
Hello, e.g I need run my my_scripts_setup.bat that contain: python myscript_setup.py py2exe Can I cover or redirect log of that process into my wx program? I'am using Windows XP SP2, and Python 2.5.
13
4198
by: rufus | last post by:
Is there a C++ compiler for windows that can be run from the commmandline? I have only be able to find MS Visual Studio but its rather overkill since I also like to just use notepad for my code.
0
8234
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8677
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
8335
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,...
1
6110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4079
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...
0
4174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
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.