Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Updating an edit box

Posted on 1998-09-15
10
Medium Priority
?
162 Views
Last Modified: 2013-11-20
I've got a VC5 dialog app that has an edit box as it's main window & was started w/ the wizard plain & simple. This edit box has a member CString and I update the box using Invalidate() & UpdateWindow. from inside a thread. For some reason it stops updating after several hundred lines. If I save the member Cstring to a file then open it back up, all the data apperas in the edit box. This is the code in the thread

UINT CTestDlg::AsyncThread(void * pParam)
{
      CMyDlg *pDlg = (CMyDlg *)pParam;
      CEdit* pOutputScreen = (CEdit*)pDlg->GetDlgItem(IDC_OUTPUT_SCREEN);
        :
      while(pDlg->m_bRunAsync)
      {
            str = GetSomeInfo();
            :
            pDlg->m_strOutputScreen += str;                              
            pDlg->SetDlgItemText(IDC_OUTPUT_SCREEN, pDlg->m_strOutputScreen);
            pOutputScreen->Invalidate();
            pOutputScreen->UpdateWindow();
            :
      }

      return 0;    // thread completed successfully
}

Any suggestions on why the box just stops updating? And no, I did not set a limit on the number of chars when I created the Cstring for the edit control.
0
Comment
Question by:Grailman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 2

Expert Comment

by:jrmcg
ID: 1322149
An edit box will only hold a certain amount of text.  Once it reaches its limit it is pretty much useless.  You might want to try and use a RichEdit control.  I believe you can  use that to do what you are needing.
0
 
LVL 1

Author Comment

by:Grailman
ID: 1322150
I'm able to run the app just fine in NT writting 700KB to the edit box but in Windows95 I can't write more than about 38K to the edit box. There is over 25MB memory free so that is ok. I can cut & paste 700KB or more into the edit box, and the CString I use for the edit box will correctly hold the 700KB when I store it to a file... I just can't display it via my app
0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1322151
jrmcg is correct.  There is a limit on the amount of stuff you can put in the edit box.  Just run Windows Notepad and see how much you can fit in there.....
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:jrmcg
ID: 1322152
thanks, thresher
I still believe I am correct about the RichEdit control also.
Although the functions of the RichEdit differ from the regular edit box,  you will still be able to do what you have described, and fit more into the box.

J.R.
0
 
LVL 1

Author Comment

by:Grailman
ID: 1322153
But what diffrence is there for this app running on 95 or NT? As I said it works fine on NT but not on 95... ?
0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1322154
I don't know about any specific differences between '95 and NT, but I know that NT does have some features that '95 does not when it comes to programming (simply browsing through functions in the help system will reveal many items stating "NT Specific" or "NT Only").
0
 
LVL 2

Expert Comment

by:jrmcg
ID: 1322155
I'm not sure why this happens, I don't use NT or develop for it.  There are functions called GetLimitText and SetLimitText for both the CEdit and CRichEditCtrl classes that are supposedly for Win95 but I have tried to set the limit and it doesn't seem to work.  If you GetLimitText it will return a value of 30000 bytes.  From what I have seen, raising or lowering the limit does not help.

Maybe someone else will know that one.

Regards,
J.R.
0
 
LVL 8

Expert Comment

by:Answers2000
ID: 1322156
>> But what diffrence is there for this app running on 95 or NT? As I said it works fine on NT but not on 95... ?

95's edit control is implemented as 16bit (hence the limit on text).  The 32 bit version simply calls the 16 bit version

NT's edit control is trully 32bit, hence the bigger limit.

0
 
LVL 1

Author Comment

by:Grailman
ID: 1322157
Answers2000:
That was my brainfade, not thinking about 95s 16 bit architecture :-{  What threw me was that the CEdit::SetLimitText description didn’t mention this (though it did in “EM_SETLIMITTEXT” Win32 documentation). Anyway since you reminded me of the architecture differences, thus explaining why it didn’t work as I wanted, if you lock the question I’ll award you the points.

0
 
LVL 8

Accepted Solution

by:
Answers2000 earned 150 total points
ID: 1322158
Thanks Grailman
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question