more then 256 characters in a static text?

I need to put more then 256 characters in a static text. I allways have this error:
  warning RC4206 : title string too long; truncated at 256
I allread searched on google but found only , which is the same question without an answer...
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You can always use


at runtime.
BTW, as an alternative to a static control, why not using a multiline edit control that is set to read onyl?
pisselouAuthor Commented:
I tried SetDlgItemText which was allso limited to 256 characters, so I suppose(d) that SetWindowText would have the same limitations...

I'll try it.

thanks, I'll post if it worked tomorrow (It's late here...).
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

pisselouAuthor Commented:
I tried SetWindowText, but can only give it one argument. When I use it then with only a string, it just sets the caption of the window to the text I setted in the SetWindowText.
>> I tried SetWindowText, but can only give it one argument

Are you using MFC? Then, try


to make clear that you are not referring to the CWnd member with the same name. Or, if so and the CStatic is a member of your class, call

Jaime OlivaresSoftware ArchitectCommented:
This error is related to a string define at resource file, but you can use SetWindowText to set larger strings. By example, you can store a 20 page text into a text file, read it, and store entirely in a control using SetWindowText. As an alternative you can use CEdit control with read-only attribute.
pisselouAuthor Commented:

I found on msdn:
but how should you read in the text so that it can be used with SetWindowText ?


Jaime OlivaresSoftware ArchitectCommented:
To read from file using MFC code:
CFile file;
if (file.Open("yourfilenamehere.txt", CFile::modeRead) {   // open successful
      int size = file.GetLength();
      buffer = new char[size+1]
      file.Read(buffer, size);  // asumming file is less than 64K long, use ReadHuge if not
      buffer[size] = 0;  // appending trailing null character
      delete buffer;

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pisselouAuthor Commented:
thanks a lot, jaime_olivares.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.