Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating a Static control

Status
Not open for further replies.

HyperEngineer

Programmer
May 8, 2002
190
US
I have an application that starts a thread. In that thread I open a dialog box in modal mode. Then I try to update a Static control. Here are some code snippets.

This is in the main dialog:
Code:
CTest Test;
hTestSequenceThread = (HANDLE)_beginthread(Test.TestSequencer, 0, (void*)this);

This is in Test.TestSequencer:
Code:
CLed LED;
INT_PTR nResponse = LED.DoModal;

Then in the child dialog box in a function called by the constructor:
Code:
CStatic* promptmessage;
promptmessage = (CStatic*)GetDlgItem(IDC_PROMPT);
promptmessage->SetWindowTextA("Prompt Message");
The GetDlgItem() line gives and assertion

Alternatively, I added a member variable m_Prompt then used the following in the function:
Code:
m_Prompt = "Prompt Message";
UpdateData(FALSE);
Here the UpdateData() function gave and assertion.

How do I access the controls in the child window from the child window?

Thanks,

HyperEngineer
If it ain't broke, it probably needs improvement.
 
hi,
Static is "static" !

Workaround this, using a normal Edit control,
removing box (frame) and setting backgrond as the dialogbox:
declare it read-only, no tabstop. ;-)

ciao
vittorio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top