CTEXT control with multi-line text

Hi,
I have a modal dialog that uses CTEXT to display a short line of text just fine.
However, I really want to display a very long line in the CTEXT.
I know that the CTEXT will break the text to fit within its width; my problem is not how the dialog displays it but how I define it in my .rc file:

1
2
3
4
5
6
7
8
9
10
IDD_ABOUT DIALOG DISCARDABLE  0, 0, 239, 66
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "My About Box"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,174,18,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,174,35,50,14
    CTEXT           "When in the Course of human events, it becomes necessary for one people to dissolve the political bands which have connected them with another, and to assume among the powers of the earth, the separate and equal station to which the Laws of Nature and of Nature's God entitle them, a decent respect to the opinions of mankind requires that they should declare the causes which impel them to the separation."
                    IDC_STATIC,16,18,144,33
END


You see the problem.

For readability, I would like to break it up something like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
IDD_ABOUT DIALOG DISCARDABLE  0, 0, 239, 66
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "My About Box"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,174,18,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,174,35,50,14
    CTEXT           "When in the Course of human events, it becomes necessary"
                    "for one people to dissolve the political bands which"
                    "have connected them with another,"
                    and so forth
                    IDC_STATIC,16,18,144,33
END


But the compiler says error RC2237: numeric value expected. Does it want the IDC_STATIC param immediately after the closing " on the first line?
How can I concatenate all those lines for my CTEXT?
You could try putting \ at the end of line as you do in C and C++. I don't know if it'll work, but I would expect it to.
kbow
Thank you for responding, but you missed the point.
I think you are telling me to put a \n where I want the line to break when it displays. That will indeed work but that is not my issue.

My issue is how to break it up in my code, not for the display.

given

1
2
3
4
5
	string dec_of_independence1 =  "When in the Course of human events, it becomes "
            "necessary for one people to dissolve the political bands which "
            "have connected them with another,";

	cout << dec_of_independence1 << endl;


the text is easier to see in the code and displays in one long line.

given your suggestion

1
2
3
4
5
	string dec_of_independence2 =  "When in the Course of human events, it becomes\n"
            "necessary for one people to dissolve the political bands which\n"
            "have connected them with another,";

	cout << dec_of_independence2 << endl;


the text is easier to see in the code and displays in three lines where I tell it to break.

I need the easier to see in the code part, not the break it up in the display part, for a CTEXT declaration.
No, I meant given
1
2
3
    CTEXT           "When in the Course of human events, it becomes necessary"
                    "for one people to dissolve the political bands which"
                    "have connected them with another,"


You'd have
1
2
3
    CTEXT           "When in the Course of human events, it becomes necessary" \
                    "for one people to dissolve the political bands which" \
                    "have connected them with another,"


It would be easier for me to check it, but I rarely have access to Windows these days.
Last edited on
Oh.

no that gives error RC2104: undefined keyword or key name: \ (I'm using Visual Studio Express 2013.)

Any other ideas? Anyone?
Topic archived. No new replies allowed.