×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

printing data to Edit Control Box

printing data to Edit Control Box

printing data to Edit Control Box

(OP)
I have found that when I write to a Edit control box using a Cedit member (while updating with ReplaceSel)eventually the field stops updating.

void CFieldDlg::OnTestEdit()
{
char buf[1150];
int num=0;
for(int i=0;i<20000;i++)
  {
   num=num+1;
   sprintf(buf,"%i",num);
   m_edit.ReplaceSel("\r\n");
   m_edit.ReplaceSel(buf);
  }
}

**This will only update up to 4339, then the field "locks up".

When I use a Cstring member, the field will not update until the full routine is completed.

void CFieldDlg::OnTestString()
{
char buf[50];
int num;
int i=0;

num=5;
sprintf(buf,"%i",num);
m_string=buf;
UpdateData(FALSE);

Sleep(3000);

num=6;
sprintf(buf,"%i",num);
m_string=buf;
UpdateData(FALSE);
}

**Only '6' prints to the field.  The 5 is not updated.


Can anyone help me with a real time, unlimited updating feature?

RE: printing data to Edit Control Box

HI,

i am not sure i understand ur question properly.
but try this code.

void CSomeClass::SomeFunc()
{
   // Assuming IDC_EDIT1 is your EditControl
   int nCnt = 0 ;
   CString str ;
   while(nCnt < 20000)
   {
     nCnt++ ;
     str.Format("%d",nCnt) ;
     GetDlgItem(IDC_EDIT1)->SetWindowText(str) ;
     Sleep(3000) ;
   }
}

GuruPrasad Belthur
belthurgp@yahoo.com
My Personal Page
Commerce Graduate, but have lived purely on computers. All the work i have done till now is only with computers and I love it.

RE: printing data to Edit Control Box

HI,

try this code.

void CSomeClass::SomeFunc()
{
   // Assuming IDC_EDIT1 is your EditControl
   int nCnt = 0 ;
   CString str ;
   while(nCnt < 20000)
   {
     nCnt++ ;
     str.Format("%d",nCnt) ;
     GetDlgItem(IDC_EDIT1)->SetWindowText(str) ;
     Sleep(3000) ;
   }
}

GuruPrasad Belthur
belthurgp@yahoo.com
My Personal Page
Commerce Graduate, but have lived purely on computers. All the work i have done till now is only with computers and I love it.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close