By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,721 Members | 1,105 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,721 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
6 Replies

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.