|
I am aware that Gator is crap and thanks for your marketing stratgey advice. No I am not interested in making any product and selling it to anyone. I am simply working on something and used Gator as an example to get some technical answers. But that seemed to have gotten lost. Thanks all the same.
|
|
|
|
|
And I hate it when I forget to log in and it puts in my reply as anonymous.
Have a good day you all.
|
|
|
|
|
Hi
A famous Newbies example to declare a CString was
CString welcome_string = "Welcome to Visual C++";
What if I want to declare a text that was as long as one paragraph? when I can't even do things like this
CString welcome_string
="Welcome to Visual C++...not finish yet continue next line
.....more text ";
there was a "newline is constant" error. Please help
Newbies
|
|
|
|
|
you need a "\" as this:
CString welcome_string
="Welcome to Visual C++...not finish yet continue next line\
.....more text ";
to let the compiler know that this line is not finished.
try it.
|
|
|
|
|
Thanks. I never thought it was so simple. What a shame.
What if I want to force it to make a newline?
Newbies
|
|
|
|
|
A new line in the text? Use \n , there's others too like \t for tab, \\ for '\', etc. Look these up (or 'escape sequences') in MSDN for more info
Dylan Kenneally
London, UK
|
|
|
|
|
Thanks
I've look at MSDN and you were right.
but when I want to type like this
CString welcome_string
= "Hello\ \n
World";
so that Hello and World are in different line, there was a "newline is constant" error.
Newbies
|
|
|
|
|
CString welcome_string
= "Hello\ \n\
World";
|
|
|
|
|
lucy wrote:
CString welcome_string
= "Hello\ \n\
World";
Thanks again. I've tried that but this came out
warning C4129: ' ' : unrecognized character escape sequence
and the line was still in one line.
Newbies
|
|
|
|
|
oops, sorry, should be
CString welcome_string
= "Hello\n\
World";
|
|
|
|
|
A lot of thanks for your reply BUT the output was
Hello|World
and not
Hello
World
this was my code
void CMyView::OnDraw(CDC* pDC)<br />
{<br />
CString welcome_string <br />
= "Hello\n\<br />
World";<br />
pDC->TextOut(0,0,welcome_string);<br />
}
Newbies
|
|
|
|
|
I'm afraid TextOut couldn't handle the "\n", but MessageBox() can. Try
MessageBox(welcome_string);
and see.
|
|
|
|
|
Thanks
Is this means only messagebox can handle "\n"? How about editbox or listbox ia a dialog?
Newbies
|
|
|
|
|
I'm not sure. You'd better check that out.
|
|
|
|
|
Thanks
Newbies
|
|
|
|
|
As Lucy said, TextOut() can not handle newlines, but DrawText() can. If you want to output multi line text use DrawText() .
HTH
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
this is easy:
CString t=
"hello \
world";
Pay attention to the backslash, type ENTER after it and go on
|
|
|
|
|
or you can do this
CString t = "Hello"
"World";
without the '\' slash character
|
|
|
|
|
I'm looking for a shading algorithm that would fill a polygon with a simple pattern according to a shade ratio.
Like this:
+ + +
+ +
A simple algo would do. I'm using the bresenham line algorithm to scan my lines and I simply want to plot my pixels according to this rule.
Thanks
Yarp
http://www.senosoft.com/
|
|
|
|
|
try a google search for "Polygon scanline conversion"; that's the 'technical' term for finding the edges of a polygon, given the points. additional hints: "Paul Heckbert" and "Graphics Gems"
-c
Though the cough, hough and hiccough so unsought would plough me through,
enough that I o'er life's dark lough my thorough course pursue.
--Stuart Kidd
|
|
|
|
|
Try with the "raster" keyword as well,
And I swallow a small raisin.
|
|
|
|
|
Hard to find indeed, even with the "raster" key word. The Internet is full of 3D Gouraud shading,... luckily one day I intend to do some 3D programming and I'll probably find my algo that time
It doesn't matter, I'll do it myself.
Thanks
Yarp
http://www.senosoft.com/
|
|
|
|
|
In Chris Maunder datagrid,does anybody know how can I overriden EndEdit() for a cell in my class?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
why don't you post this question on the grid article?
Though the cough, hough and hiccough so unsought would plough me through,
enough that I o'er life's dark lough my thorough course pursue.
--Stuart Kidd
|
|
|
|
|
More people see it here.I post it there too.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|