Solved

Editing a TextBox.

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Macro to save highlighted rows as a separate file 5 41
Process filename extension 3 172
iSeries DB2 Query 2 89
MaxSpan challenge 9 79
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
A short film showing how OnPage and Connectwise integration works.

939 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

10 Experts available now in Live!

Get 1:1 Help Now