473,395 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

StandardOutput and RedirectStandardError Problem

Hi

I am developing win32 application and I am calling function from extern DLL

for example something like this

1) import function

[DllImport("extern.dll")]
public static extern int translate(int num, string[] arr);

this function is written in C++

2) then I in button_on_click procedure I am calling

translate(8,arr);

and it works fine but problem is that sometimes extern function write
something into stdout (standart output stream) for examle error message
(I can see this message in debug window in VisualStudio). This is similar
problem if u in win ap write this System.Console.Write("some text");

And my question is How can I get access to this stream from win32 ap. and
write it into textbox for example ?
Thanks very much for your answer.

ivan

--
Message posted via http://www.dotnetmonster.com
Nov 16 '05 #1
2 2970
Ivan,

You would want to call the SetIn, SetOut, or SetError methods on the
Console classes to replace the standard output with a TextReader that you
can read the output from.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"ivan mjartan via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in
message news:9e******************************@DotNetMonste r.com...
Hi

I am developing win32 application and I am calling function from extern
DLL

for example something like this

1) import function

[DllImport("extern.dll")]
public static extern int translate(int num, string[] arr);

this function is written in C++

2) then I in button_on_click procedure I am calling

translate(8,arr);

and it works fine but problem is that sometimes extern function write
something into stdout (standart output stream) for examle error message
(I can see this message in debug window in VisualStudio). This is similar
problem if u in win ap write this System.Console.Write("some text");

And my question is How can I get access to this stream from win32 ap. and
write it into textbox for example ?
Thanks very much for your answer.

ivan

--
Message posted via http://www.dotnetmonster.com

Nov 16 '05 #2
Oh thanks a lot nikola but can u be more specific, or can I see somewhere
part of code ?

I am novice in C#

thanks ivan

--
Message posted via http://www.dotnetmonster.com
Nov 16 '05 #3

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

Similar topics

0
by: John Lewin | last post by:
I've recently discovered the value of using existing console applications in managed .net apps. Unfortunately, I've stumbled into a problem with a particular console application that check's crc...
2
by: mwazir | last post by:
Hi all, I have reposted this question from dotnet.general as I have been advised that this is a more appropriate forum for this question. Apologies for the repost. I have a process thats...
15
by: Matt Burland | last post by:
I'm having a problem with redirecting the StandardOutput of a process that I use to run a DOS program in my application. The problem is that I when I start my process (which I do in a separate...
1
by: Yash | last post by:
Hi, Through my VB .NET code , I am trying to invoke a perl script. My aim is to write lines to the script and read from it. With ProcInfo .Arguments = Enricher.EnrichScript + " " + enArgs...
0
by: CMG | last post by:
I am trying to run gocr from my program, and use the output. I have done this with success befor, with a workaround command line tool.: Private irfanview As String = "C:\program...
0
by: BasicQ | last post by:
I am running an executable from my aspx page with the click of a button. A date is passed as an argument. I am able to get the standardoutput from the Process(Exe) into the label of my page after...
2
by: mwazir | last post by:
Hi all, I have a process thats starts in my application and only terminates when my application is terminated. I want to write the output and the errors of this process to a seperate log file....
0
by: mikepl746 | last post by:
I'm trying to run the svn command in a System.Diagnostics.Process to parse the StandardOutput. If I run the command in a CMD window while Regional settings are set to Japanese I see something like...
3
by: Clutch152 | last post by:
First off, hello everyone. This site has helped me find answeres to numberous questions. What I want to make is a kill tracker for Wolfenstein enemy territory and I want the program to find kills...
1
by: lapucca | last post by:
Hi, I'm using VS 2005, ,.net 2 for C# windows application. I'm using Process to run a C application and redirecting its standard output so I can read it with StreamReader.ReadToEnd. It's only...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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,...

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.