473,804 Members | 3,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Streaming message box

Greetings!

I have just returned to C++ after a couple of years in the FoxPro and
C# worlds. I am trying to adapt and expand existing code. For
debugging and just plain understanding the code I'm working with, I'd
like to put little message boxes into the code. It seems a pain to
declare a character array, write my message into it, and then call
AfxMessageBox() to dispaly it. It seems to me that it would be easy to
create a stream-based messagebox class that I could use as follows:

StreamMessageBo x << "My value is " << MyValue;

This would pop up a simple message box with a single OK button and my
message. It should be easy to add manipulators to this class to select
icons and use different button sets.

Does such a thing exist? If so, where can I get it?

Thanks very much!

RobR

Jun 7 '06 #1
3 2228
CedricCic...@gm ail.com wrote:
Greetings!

I have just returned to C++ after a couple of years in the FoxPro and
C# worlds. I am trying to adapt and expand existing code. For
debugging and just plain understanding the code I'm working with, I'd
like to put little message boxes into the code. It seems a pain to
declare a character array, write my message into it, and then call
AfxMessageBox() to dispaly it. It seems to me that it would be easy to
create a stream-based messagebox class that I could use as follows:

StreamMessageBo x << "My value is " << MyValue;

This would pop up a simple message box with a single OK button and my
message. It should be easy to add manipulators to this class to select
icons and use different button sets.

Does such a thing exist? If so, where can I get it?

Thanks very much!

RobR


Well, you're talking about a platform-specific library since Standard
C++ doesn't have anything but text/binary I/O. Thus, you should ask in
a Microsoft newsgroup about the existence of such a library. See this
FAQ for some possibilities:

http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

But, you're right that it shouldn't be too hard to add that. I suspect
you'll need to always have a manipulator at the end, however, to
indicate that you're done appending the message and that it should now
be displayed.

Cheers! --M

Jun 7 '06 #2
Ce**********@gm ail.com wrote:
I have just returned to C++ after a couple of years in the FoxPro and
C# worlds. I am trying to adapt and expand existing code. For
debugging and just plain understanding the code I'm working with, I'd
like to put little message boxes into the code. It seems a pain to
declare a character array, write my message into it, and then call
AfxMessageBox() to dispaly it. It seems to me that it would be easy
to create a stream-based messagebox class that I could use as follows:

StreamMessageBo x << "My value is " << MyValue;

This would pop up a simple message box with a single OK button and my
message. It should be easy to add manipulators to this class to
select icons and use different button sets.

Does such a thing exist? If so, where can I get it?


If it exists, you could find out about it in a newsgroup where
'AfxMessageBox' is on topic, I am sure. Generally speaking all you
need is to define a class that overloads operator << as a template
and has a special (non-template, say) operator << to "show" itself.
It would be used like this:

StreamMessageBo x << "My value is " << MyValue << show;

or

StreamMessageBo x << "My value is " << MyValue;
StreamMessageBo x.show();

I don't think you want to attempt to make your messagebox show itself
at the end of "full expression". It's just too tricky. Besides, the
behaviour should be the same if you say

StreamMessageBo x << "My value is "; StreamMessageBo x << MyValue;

don't you think? That's why you need not only the operator << but
also the 'show' thingie.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jun 7 '06 #3
Thank you very much for your replies. I appreciate your thoughts and I
also appreciate you pointing out that I was asking an MS-specific
question and therefore should have been on an MS-specific list. I will
repost to one.

RobR

Jun 7 '06 #4

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

Similar topics

7
2473
by: Larry Woods | last post by:
Could you give me an example of streaming a page to the client? Thanks. Larry Woods
1
1457
by: WildHare | last post by:
What exactly is streaming? When I use a browser or an application and it gets streaming data (say, Headlines, Stock Quotes, etc), what is it really doing. Is it just that the client is constantly making new requests for information from a given web server, or is there more magic to it? It sounds like we are opening a connection and getting a constant "stream" of information...is this the case, or is it just an illusion. If it really...
3
2344
by: A.M-SG | last post by:
Hi, I have a ASP.NET aspx file that needs to pass large images from a network storage to client browser. The requirement is that users cannot have access to the network share. The aspx file must be the only method that users receive image files.
6
2734
by: | last post by:
Hi all, is there a better way to stream binary data stored in a table in sql 2005 to a browser in .net 2.0? Or is the code same as in .net 1.1? We noticed that in certain heavy load scenarios, every now and then the client would timeout and have to re-initiate the request... TIA!
2
9755
by: mpaliath | last post by:
Hi guys I am currently involved in a project which requires me to recieve and play streaming video as well as send it. In Visual C++ is there any free library which helps me do this as 'streaming' is not part of the actual project, i am allowed to use external libraries. Also could anyone tell me where I can learn about video streaming in c++ so I can code the streaming part myself too thx
8
65840
by: Amjad | last post by:
Hi i am writing a application where i want to browse video file and copy data into stream and send that stream over network...I have develop P2P windows application where i successfully transfer text message to each other but now i want to send video file and play that file on other end...I know the code how to send the stream over the network but basic problem is how open that file as a stream. Thanks
8
3108
by: Tony K | last post by:
Is streaming audio capable in asp.net 2.0 / AJAX? What I mean by streaming audio is: ability to play one or more songs back to back...or maybe even let the user select several songs to play and it will play them back to back. Thanks, Tony K
5
3557
by: pmakoi | last post by:
dear all this might be a piece of cake for some of you out there but it is causing me a lot of stress given the fact that there is not enogh documentation out there regarding this topic I am writing a web service that uses soap with attachments to send a large streaming data, The concept works quite well but when I started to test it I got this problem. When my client program calls a method that should return a real time data the...
3
4047
by: Brad | last post by:
I have an aspx page that is sending pdf files to client browsers: it uses a filestream to read the pdf file and response.binarywrite to send content to the browser. This has worked great for years in IE, Firefox and Opera on windows, and it works on a Mac with Firefox and Opera. But this fails in Safari with the generic message "A network error occurred while accessing this document". Here is a link to try out ...
1
2864
by: Faisal Shafiq | last post by:
I want to upload a file direct to the Silverlight Streaming Service from a Web Client such as silverlight application. As per our product requirement we want to upload a .WMV file directly from silverlight client to Silverlight streaming service. I tried to user WebClient and HttpWebRequest for that purpose but, unfortunately I can found the way to do so. There are some problems with both classes. 1. There is no property of get...
0
10569
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
10325
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
10075
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...
1
7615
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6847
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
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
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.