Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7983703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:02:34+00:00 2026-06-04T11:02:34+00:00

m_editText is of type CEdit (from MFC). This has worked fine for years with

  • 0

m_editText is of type CEdit (from MFC). This has worked fine for years with hundreds of users in WinXP (32bit), but when the same executable file is on Win7 (64bit) some users are getting (in strText) extra weird (i.e. extended, i.e. garbage) characters appended to the text that they typed in the edit box control (m_editText). I can’t reproduce problem. I verified that GetLine copied only the characters that are typed into edit box (at least on my machine).

TCHAR atchBuffer[256] = {0};  // initialize to all nulls
int nChrCount = m_editText.GetLine(0, atchBuffer, 255);
CString strText;
if (nChrCount!=0)
    strText = CString(atchBuffer);

This is compiled (debug build) in Visual C++ 6 on WinXP (32bit), MFC 5 statically linked. Any insight provided will be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:02:35+00:00Added an answer on June 4, 2026 at 11:02 am

    Change your code like this:

    if (nChrCount!=0)
        strText = CString(atchBuffer, nChrCount);
    

    to make sure that any garbage/uninitialized data does not get added to the CString, only the chars that are in the control.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question probably reveals my total lack of knowledge in Java. But let me
I'm using a number Picker to get a information from the user, but when
I'm writting an Android's app. Two activities, one has TextEdit to type 'hello message',
I'm still pretty new to this, but I'm trying to make a calculator for
I put this code from answer Displaying emoticons in Android for showing emoticons in
My application has the following modules, To collect users CB location code. To save
I want my keyboard to have caps lock on, this is done by mEditText.setInputType(TYPE_TEXT_FLAG_CAP_CHARACTERS);
I am new to Android development. In my project, I’m using EditText, but I
I'm trying to insert data into the SQLite database using get EditText, but I
I need a EditText that fills in height my window. I'm using this: <ScrollView

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.