HyperEngineer
Programmer
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:
This is in Test.TestSequencer:
Then in the child dialog box in a function called by the constructor:
The GetDlgItem() line gives and assertion
Alternatively, I added a member variable m_Prompt then used the following in the function:
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.
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");
Alternatively, I added a member variable m_Prompt then used the following in the function:
Code:
m_Prompt = "Prompt Message";
UpdateData(FALSE);
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.