473,657 Members | 2,921 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3705

"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
2322
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 main page from the code behind the contents page. I want to do this to allow the use of asp "linkbuttons" instead of hyperlinks so I can do a little processing before redirecting. The main reason for this to prevent hyperlinks of pages that have...
2
3704
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 + '; ' + 'resizable: no; help: no; status: no; scroll: no; ' + 'dialogLeft:0; dialogTop:0;');
2
7079
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 dialog window? 2. The dialog window in question was, in turn, created from a dialog window. I need to post data back to that one too (that which the user selected in the top-most dialog window). How do I send data back to this window?
2
1811
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 here ... i also have the following codebehind class code to set the action of the button on click to run a modal dialog as follows: Page_Load ..... load code here ... AddButton.Attributes.Add("onclick",...
3
2875
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 save the data and close the dialog when the page is valid. I have read a little about using Iframes to post back to, but was wondering if this would work for what I am trying to do? Also, does anyone have a code sample of this (postback from modal...
8
5778
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 technically create an executable that calls the function and then using a command prompt call the exexutable using the > output.txt redirector but I would prefer to do everything within the application itself. Is there a way for force an output...
2
3680
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 dialog. To be more specific I want to have a confirmation dialog that is shown when a user clicks on a Delete button (which deletes some values from database). If Yes is pressed the delete action is processed otherwise modal dialog is closed.
1
1452
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 i am using window.location and my code is as follows <html> <head> <script type="text/javascript"> var confirm = true; window.onbeforeunload = unload; function unload() { if(confirm)
11
2351
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 realized that despite suggestions to use DHTML-based modal dialogs are very common? there is not a single fully functional reliable copyright-free cross-browser alternative to say MsgBox (VBScript) or showModalDialog (IE). This way such suggestions up to...
0
8385
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
8303
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8821
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...
0
8723
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8602
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7316
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
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...
2
1601
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.