Winapi: edit control not expanding its buffer - c++

According to MSDN:
When the system creates an edit control, it automatically creates a text buffer, sets its initial size, and increases the size as necessary.
Yeah, only it doesn't. I have an edit control in my app that shows various logs, and I keep adding text to it using EM_SETSEL message (to find the end of the text in control's buffer) and EM_REPLACESEL message (to append some text to it). I don't know if it's a best way, but it's been working well so far. Today, however, I found out that if I try to append some text when there are lots of logs in edit control already, my app fails to do so. Maximum lenght of text that's shown in it is equal to 30k characters and when I try to append any more logs, it just fails, nothing happens. At first I set it as read-ony edit control, but nothing changes if I make it editable. Just when I try to type more than 30k characters in it, it acts as if I wasn't typing anything.
And now: I know that you can handle buffer expanding by yourself, but that's not the case here. If it is written that it should be expanded automatically, why doesn't it occur? Maybe I accidentaly set something that stops the application from increasing the buffer's size? I don't know and I can't find any answer to that, so I was just wondering if there's any way to actually make my application to expand that buffer on its own.

You need to set a text limit with the EM_LIMITTEXT message. Otherwise:
Before EM_LIMITTEXT is called, the default limit for the amount of
text a user can enter in an edit control is 32,767 characters.

Related

Read input live from the terminal C++

I want something with C++ that can read what I type in the terminal and assign it to a string variable.
I want this for a project to make something like notepad, but in simple terminal form, so I need to have live user input available to get word count and stuff.
Unfortunately, I couldn't find anything on the internet about this, and I only found sites that talked about keyboard input, but I don't want that.
I tried to test this using the getch() function and there was no problem in writing and getting input.
But when the user wants to delete something, we don't know which character the user deleted, because we don't have the selected character, if we have it, when we print it after getting the character (if we don't print the user he just writes and doesn't know what he wrote) the problem is that the page must be cleaned once after deleting a letter and this causes the terminal to tick

Change font size in WEKA Explorer

I need to be able to use the WEKA Explorer GUI but make the font size bigger for displaying to an audience. I was able to change the fonts for some parts of the text by modifying the call to java in the file RunWeka.ini Specifically, I changed the first uncommented line to
cmd_default=javaw -Dswing.aatext=true -Dswing.plaf.metal.controlFont=Tahoma-plain-18 -Dswing.plaf.metal.userFont=Tahoma-plain-18 -Dfile.encoding=#fileEncoding# -Xmx#maxheap# -Djava.net.useSystemProxies=#systemProxies# #javaOpts# -classpath "#wekajar#;#cp#" #mainclass#
The difference from what comes with the Weka distribution is that I added the first three arguments - the ones that begin with -Dswing. This changes the font size in many places but fails to change a few places as marked in the screen shot below.
Does anyone know how to change the font size for the remaining text? Another argument to java?

Various methods to get entire text in a rich edit control as a CString

I want to get the entire text in a rich edit control as a CString, and from my reaseach
there appear to be six ways of achieving this:
GetTextRange and get the range by using GetTextLength
EM_GETTEXTEX
GetWindowText
GetDlgItemText
WM_GETETXT
EM_STREAMOUT
My questions are as follows:
What is the difference between using methods such as GetTextRange, GetWindowText, and GetDlgItemText versus using messages such as EM_GETTEXTEX, WM_GETETXT, and EM_STREAMOUT.
When would you use one type, and when would you use another?
What is the difference between EM_GETTEXTEX, WM_GETETXT, and EM_STREAMOUT in terms of accomplishing this task of getting the entire text in a rich edit control as a CString?
Finally would it be possible for someone to provide an example of how to use EM_GETTEXTEX, or point me in the direction of one online?
All are the same, except EM_STREAMOUT.
No. 1 to 5 just get the plain text. No. 6 gets the complete RTF stream.
So No. 1. to 5. are just methods that do nearly the same as sending WM_GETTEXT.

Add line-break to open graph meta tag [duplicate]

This is an URL I have to send an invitation to an app of mine:
https://www.facebook.com/dialog/send?app_id=MY_APP_ID&
name=hola&
link=http://www.aWebSite.com&
picture=http://www.aWebSite.com/im01068442.jpg&description=participar!&
redirect_uri=http://elsuperdt.com
I'm trying to have a linebreak included within the description, but I just haven't found a way to do so. How do I do it?
I had the same issue and eventually gave up. Facebook seems to have gone to great lengths to avoid letting us have any linebreaks in the description.
The one thing you can do is add a &caption=first%20line which gets you one linebreak between the caption and the description. (There's a pretty short limit on how long the caption can be though - something like 80 characters.)
Update: this no longer works for send dialogs. It does still work for feed dialogs
Try using <center></center> this will create a new line in Facebook dialog description.
Try including %0D%0A in your description where you want the line break to be. This is the URL-encoded equivalent of a line break.
\n works in message but not in name parameter
I tried center></center> and %0D%0A. Both worked... for a split second. You could see the breaks upon page load, and then, like evil magic, facebook took it away and it was all scrunched up. Too bad. I'm trying to share a daily schedule, which would look much better with line breaks.
You can use blanks that are not posted to facebook in the length of the feed so the line breaks.
Or you just style your post by adding ".........." in the end of each line. This way people would maybe be more attracted to your post as they are eyecatching.

Aspose, append Pdf's without extra space

I've got list of Pdf objects (or Streams) and would like to append them that there wont be extra white space between them. Aspose 'PdfFileEditor.Concatenate' adds next Pdf starting from next page but I'd like to add it immediately after previous finishes.
Is it possible?
I don't know if that was possible (there wasn't much time) so had to refactor the code that only one stream was created with correct layout.