By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,460 Members | 1,508 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,460 IT Pros & Developers. It's quick & easy.

StandardOutput and RedirectStandardError Problem

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.