Dear Chris,
Well, forget about CEdit and Microsoft! Read char[] instead CEdit. My
question is about the streams redirection in standart C++, not about the
features of CEdit.
ofstream and ifstream is in Borland C++, GNU C++, MS VC++. The three
functions I have mentioned in my questions can be compiled in all above and
also in IAR eMbedded C++.
I guess this is quite standart C++ issue, isn't it?
To tell the compleate story the metter is that I try to leave this three
functions on standart C++ for source-level compatability, that's why I don't
want to change their code during integration into my MFC application.
Bye.
I have three question about ofstream and ifstream.
1. I have a function that writes some text-output into ofstream. The
reference to that ofstream it got as a parameter. I have no access to
source code of it. I need redirect the output to somehing, for example to a
CEdit control.
2. I have a function that writes some text into cerr (stderr). No
parameters. No access to source code. I need redirect the output to
somehing, for example to a CEdit control.
3. I have a function that reads text from cin (stdin). No parameters. No
access to source code. I need to send into this function text from my
char[] or from CEdit control.
I know a bit about redirection of stdin and stdout for a child process
using pipes and streambuf overlapping. But there is only one process in my
application.
I can create a thread, but I don't want it.
Best regards,
Shestero Michael
You will have to ask this specific questions in a Microsoft VC newsgroup
because this newsgroup deals with standard C++ issues only.
[off-topic]
If I remember correctly there is a way of at least redirecting output from
cout to a window, as MS uses it for its Visual Studio. Try
ww.codeguru.com - I think I once saw a discussion about that there.
Chris