473,320 Members | 1,857 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,320 software developers and data experts.

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:

StreamMessageBox << "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 2214
CedricCic...@gmail.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:

StreamMessageBox << "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**********@gmail.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:

StreamMessageBox << "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:

StreamMessageBox << "My value is " << MyValue << show;

or

StreamMessageBox << "My value is " << MyValue;
StreamMessageBox.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

StreamMessageBox << "My value is "; StreamMessageBox << 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
by: Larry Woods | last post by:
Could you give me an example of streaming a page to the client? Thanks. Larry Woods
1
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...
3
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...
6
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,...
2
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...
8
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...
8
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...
5
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...
3
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...
1
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.