Solved

Editing a TextBox.

Posted on 1998-11-26
2
178 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Whole sheet autoscrub still needed 19 51
NotAlone Challenge 20 84
Problem to event 3 102
Message not shown 5 66
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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 video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

790 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