Get/Set WindowText questions
Posted on 1998-08-15
Part of my program has to get information from a dialog box and format and display the information into the current document. This is easy using SetWindowText(). The only problem is that I must create an obsurd number of CStrings in the formatting process and I get memory reading errors. If the answer is use GetWindowText, what kind of type declaration should be used for the buffer that will hold the window's text? Is there a better way to do this? Also, is there a way to GetWindowText relative to the cursor so something could be displayed at the cursor location.
CString fubar = GetWindowTextBeforeCursor();
CString marsupial = "text";
CString foo = GetWindowTextAfterCursor();
CString alltogethernow = fubar + marsupial + foo;
Is there any way to do this?