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

M

meyzhong

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();
 
S

Stuart Redmann

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
 
G

Guest

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-lite/how-to-post.html#faq-5.9
 
S

Stuart Redmann

Erik said:
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
 
G

Guest

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.
 
S

Stuart Redmann

Erik said:
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
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,278
Latest member
BuzzDefenderpro

Latest Threads

Top