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

how to display the multi-line information into a box in VC++ 6.0?

Hi,

I am new to Visual C++ (6.0). I want to put all the print information
in different lines into a box.

I create a EDIT dialogue box, and then add a CString variable (m_MSG)
to the dialogue box to display the print information in the box.
However, the print information displayed in the box is in one line,
like this "10.0| 20.0". The "\n" character for the change to a new
line has not been recognized.

How to display the information into different lines in the box? Does
this "EDIT" box only allow a one-line string? Should I use any other
"Box"?

Looking forward to your help.

Regards,

James

The program is the following for the detailed information:

CTty3Dlg dlg;
m_pMainWnd = &dlg;
char textbuffer[40];
double t1= 10.0, t2=20.0;
sprintf(textbuffer, "%f\n",t1);
dlg.m_MSG = textbuffer;
sprintf(textbuffer, " %f", t2);
dlg.m_MSG = dlg.m_MSG + textbuffer;
int nResponse = dlg.DoModal();

Oct 5 '07 #1
6 2618
me******@mail1.monash.edu.au wrote:
Hi,

I am new to Visual C++ (6.0). I want to put all the print information
in different lines into a box.
[snip]

As you are new to C++ programming, I guess that you are new to newsgroups as
well. For some reasons you have found comp.lang.c++, but not
microsoft.public.vc.mfc, which deals exactly such questions like the one you
posted here. As this newsgroup is dedicated only to matters of C++ and not to
matters of particular C++ libraries like MS's MFC, you are off-topic here.
Please refer to above mentioned newsgroup (and it also pays to have a look at
the netiquette section of http://www.parashift.com/c++-faq-lite).

Regards,
Stuart
Oct 5 '07 #2
On 2007-10-05 09:36, me******@mail1.monash.edu.au wrote:
Hi,

I am new to Visual C++ (6.0). I want to put all the print information
in different lines into a box.
Then I would suggest that you upgrade, VC++ 6 is old and buggy. You can
get VC++ 2005 Express for free from MS site, or download a gcc based IDE
such as CodeBlocks.
I create a EDIT dialogue box, and then add a CString variable (m_MSG)
to the dialogue box to display the print information in the box.
However, the print information displayed in the box is in one line,
like this "10.0| 20.0". The "\n" character for the change to a new
line has not been recognized.
Windows programming is off-topic in this group, you should ask in a
group discussing windows programming, take a look in the FAQ for some
suggestions: http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

--
Erik Wikström
Oct 5 '07 #3
Erik Wikström wrote:
On 2007-10-05 09:36, me******@mail1.monash.edu.au wrote:
>>Hi,

I am new to Visual C++ (6.0). I want to put all the print information
in different lines into a box.

Then I would suggest that you upgrade, VC++ 6 is old and buggy. You can
get VC++ 2005 Express for free from MS site, or download a gcc based IDE
such as CodeBlocks.
If you know about Visual C, why do you suggest that he should download VC2005
(being freely available)? As you should have noticed he uses MFC, which is not
part of VS2005 Express, so your suggestion is somewhat pointless (unless you are
paid from MS for your suggestions).

Stuart
Oct 5 '07 #4
On 2007-10-05 14:10, Stuart Redmann wrote:
Erik Wikström wrote:
>On 2007-10-05 09:36, me******@mail1.monash.edu.au wrote:
>>>Hi,

I am new to Visual C++ (6.0). I want to put all the print information
in different lines into a box.

Then I would suggest that you upgrade, VC++ 6 is old and buggy. You can
get VC++ 2005 Express for free from MS site, or download a gcc based IDE
such as CodeBlocks.

If you know about Visual C, why do you suggest that he should download VC2005
(being freely available)? As you should have noticed he uses MFC, which is not
part of VS2005 Express, so your suggestion is somewhat pointless (unless you are
paid from MS for your suggestions).
I know of VC++ but nothing of MFC so I totally failed to recognise his
code as such, it could have been code using any number of libraries.
Besides, I seem to recall that it is possible to use VC++ 2005 Express
and MFC, if you have MFC installed. And VC++ is old and buggy and should
not be used unless you have to.

--
Erik Wikström
Oct 5 '07 #5
Erik Wikström wrote:
I know of VC++ but nothing of MFC so I totally failed to recognise his
code as such, it could have been code using any number of libraries.
Besides, I seem to recall that it is possible to use VC++ 2005 Express
and MFC, if you have MFC installed. And VC++ is old and buggy and should
not be used unless you have to.
That sounds interesting. AFAIK, Visual Studio 2005 Express is free for the only
reason that there is very little one can do with it (except writing
console-based applications). If you knew anything about how to make VS2005 work
with MFC 6.0, I'd be very happy if you could share your wisdom.

Regards,
Stuart
Oct 5 '07 #6
On 2007-10-05 15:37, Stuart Redmann wrote:
Erik Wikström wrote:
>I know of VC++ but nothing of MFC so I totally failed to recognise his
code as such, it could have been code using any number of libraries.
Besides, I seem to recall that it is possible to use VC++ 2005 Express
and MFC, if you have MFC installed. And VC++ is old and buggy and should
not be used unless you have to.

That sounds interesting. AFAIK, Visual Studio 2005 Express is free for the only
reason that there is very little one can do with it (except writing
console-based applications). If you knew anything about how to make VS2005 work
with MFC 6.0, I'd be very happy if you could share your wisdom.
Moving off-topic...

I would suspect that the main reason for releasing VC++ 2005 Express is
to make people use C++/CLR (the .Net version of C++) which is fully
supported in the Express version.

I have never tried to compile MFC applications my self but I think the
trick is to make VC++ 2005 Express use the MFC-libraries installed with
VC++ 6.

--
Erik Wikström
Oct 5 '07 #7

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

Similar topics

4
by: Scott Vercuski | last post by:
Hello All, I'm having a problem saving/displaying multiple lanaguages on an ASP page. Here's the general problem I'm having. I have an admin area of a website that allows a user to enter items...
1
by: work4u | last post by:
From my system, it allow product has multi-category, so I need to save all category names which one product belong to into one field on a database, and record saved like " nameA|nameB|nameC " ...
6
by: radnoraj | last post by:
Hi, I am sucessfull in redirecting console output to a file. but in this case nothing is displayed on the console, cout output is written to file without display. how do write the output to...
15
by: Markus Ernst | last post by:
Hi When toggling an element on and off by setting its display property via DOM access, display:none is valid for all kinds of elements, but I can't find anything about a generic value for...
2
by: Ivan | last post by:
I have a class Foo which have two property. I have a thread that do some process and update class Foo int B. I have a datagridview on main form. this datagridview data source to this class Foo and...
1
by: Gurunadh | last post by:
Hi friends, we have developed a windows desktop application in vb.net 2005 with MS-Access as backend ,our problem is we have to display data from a datagridview to a crystal report,we have...
1
by: Gurunadh | last post by:
Hi friends, we have developed a windows desktop application in vb.net 2005 with MS-Access as backend ,our problem is we have to display data from a datagridview to a crystal report,we have...
2
by: Victor | last post by:
Hi guys i am facing a real big problem here. I bought a hosting plan and try to build my own website. my website has several language version(chinese english japanese). but i just found out the...
1
by: freetime | last post by:
Greetings, This is my first post so I will try to be brief and accurate. I have a report that uses 9 user selectable filters (Dates, Y/N's as Combo Boxes and 4 Multi-Select List Boxes. ...
14
by: confusedfusion | last post by:
Not sure how many form submissions that have been lost over the years before I started but the company has a contact form that the required fields when validation fails the error message is going...
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.