473,406 Members | 2,220 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,406 software developers and data experts.

redirecting cout to dialog window

did any know how redirect standard cout to edit in dialog window?
i work in ms vc++ and i don't want use mfc. please help..
sorry for my poor english
Jul 22 '05 #1
3 3694

"Pawel Kruczynski" <kr**@op.pl> wrote in message
news:c8**********@news.onet.pl...
did any know how redirect standard cout to edit in dialog window?
i work in ms vc++ and i don't want use mfc. please help..
sorry for my poor english


Write your own streambuf derived class that outputs to the dialog window.

Then use it like this (say your class is called MyBuffer)

MyBuffer my_buffer(...);
streambuf* old_buffer = cout.rdbuf(&my_buffer);
// cout will now be redirected to your dialog box
....
cout.rdbuf(old_buffer);
// now cout is back to normal

For details on how to write streambuf derived classes consult a good book on
the STL, for instance 'The C++ Standard Library' by Josuttis

john
Jul 22 '05 #2

Użytkownik John Harrison <jo*************@hotmail.com> w wiadomo¶ci do grup
dyskusyjnych napisał:2h************@uni-berlin.de...

"Pawel Kruczynski" <kr**@op.pl> wrote in message
news:c8**********@news.onet.pl...
did any know how redirect standard cout to edit in dialog window?
i work in ms vc++ and i don't want use mfc. please help..
sorry for my poor english

Write your own streambuf derived class that outputs to the dialog window.

Then use it like this (say your class is called MyBuffer)

MyBuffer my_buffer(...);
streambuf* old_buffer = cout.rdbuf(&my_buffer);
// cout will now be redirected to your dialog box
...
cout.rdbuf(old_buffer);
// now cout is back to normal

For details on how to write streambuf derived classes consult a good book

on the STL, for instance 'The C++ Standard Library' by Josuttis

john


Thanks a lot John
Jul 22 '05 #3
> did any know how redirect standard cout to edit in dialog window?
i work in ms vc++ and i don't want use mfc. please help..
sorry for my poor english


Standard C++ has no GUI, so there is no such thing as "dialog window"
in Standard C++.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
To iterate is human, to recurse divine.
-L. Peter Deutsch
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Jul 22 '05 #4

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

Similar topics

3
by: lozd | last post by:
Would appreciate any solutions people could offer for this. Basically I wan't to use a frameset with an aspx page as the contents rather than a htm page and I'd like to be able to redirect the...
2
by: Foehammer | last post by:
I have the following snippet of code: function ShowTutorial(tutorialPath) { var ret = showModalDialog(tutorialPath, '', 'dialogWidth:' + screen.width + '; dialogHeight: ' + screen.height + ';...
2
by: John | last post by:
Hi all, I have a modal dialog window from which a user selects a few rows from a datagrid and then clicks on an image button. My question is two-fold: 1. How do I post data back to the same...
2
by: Patrick | last post by:
i have the following .aspx file defined: ..... other tags here ... <asp:TableCell><asp:button id="AddButton" Runat="server" Text="Add New Vessel..."</asp:button></asp:TableCell> ..... other tags...
3
by: Earl Teigrob | last post by:
Can a Modal Dialog Box do forms ASP.NET forms validation from within the Modal Box? I want to pop up a dialog box to the user and have it do its own post backs with validation checking and then...
8
by: Morpheus | last post by:
I am trying to test a function that outputs text to the standard output, presumably using a cout call. I do not have access to the source, but need to test the output. Is this possible? I can...
2
by: sthrudel | last post by:
Hi! I'm working on a web application in Asp.net and what I would like to have is a cross borwser modal dialog which accepts user's input. I would like to catch what the user clicked on the...
1
by: sreekeerthi | last post by:
hi friends...this is keerthi...i am doing a project where i want to redirect my page when ever the back button is clicked...for this i am using window.onbeforeunload method..and for page redirection...
11
by: VK | last post by:
In the continuation of the discussion at "Making Site Opaque -- This Strategy Feasible?" and my comment at http://groups.google.com/group/comp.lang.javascript/msg/b515a4408680e8e2 I have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
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
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...
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,...
0
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...

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.