Solved

Editing a TextBox.

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

705 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