?
Solved

Editing a TextBox.

Posted on 1998-11-26
2
Medium Priority
?
181 Views
Last Modified: 2013-11-20
ok, I have a text box  (IDC_TEXT1)  on the main dialog box named  CZDSpcDlg

and I made a variable  (CEdit buttontext;)  in Public.

and I did the DoDataExchange  (DDX_Control(pDX, IDC_TEXT1, buttontext);

I can edit the text box in the same class like this :

buttontext.SetWindowText("HEY!");

but when I try to edit the text from a different class, (eg:CMFCDDEServer)  like this:

CZDSpcDlg dlg;
dlg.buttontext.SetWindowText("HEY!");

it doesn't change the text in the box!! it doens't cause an error when compiling.. and I know that I'm calling that part cause I even tried making a MessageBox(0,"hehe","hehe",MB_OK);  
and it worked fine.. but it just won't change the text of that text box from a different class.

can ANYONE help me out!?!?

Thanx.
0
Comment
Question by:needhlp
[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
2 Comments
 
LVL 2

Accepted Solution

by:
cyrilbdt earned 100 total points
ID: 1325341
>>CZDSpcDlg dlg;
>>dlg.buttontext.SetWindowText("HEY!");
it won't change the text since it is not no screen and there should be ASSERT rise with ::IsWindow(hwnd)
0
 
LVL 1

Expert Comment

by:The_Brain
ID: 1325342
When you edit or change anything in an EditBox.
eg.


m_Edit1=""

later changed.

in say
BLAH::OnButton1
{
    Stuff_which_you_want[6]="HELLO";
    m_Edit1=Stuff_which_you_want;
    UpdateData(FALSE) <----- NB  this refreshes all Editboxes to  say what ever is designated to it.



}

if you want to take in Info.

UpdateData(TRUE)
STRING=m_Edit1;


any other problems, Please E-Mail me at g_dutoit@hotmail.com
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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 is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

777 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