Solved

Editing a TextBox.

Posted on 1998-11-26
2
175 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
2 Comments
 
LVL 2

Accepted Solution

by:
cyrilbdt earned 50 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now