Visual C ++ 6.0 dialogue based on the MFC AppWizard (exe).
1 answer
One option is to send messages from the stream to the main window, and in the message handlers to update any information in the window. Example:
static UINT CSomeClass::UpdaterProc(LPVOID context); UINT CSomeClass::UpdaterProc(LPVOID context) { const HWND handle = reinterpret_cast<HWND>(context); ASSERT(handle != NULL); // Послать сообщение из потока ::PostMessage(handle, WM_USER, ...); return 0; }
and
void CSomeClass::OnCreateUpdaterThread() { // Создать поток и передать хэндл AfxBeginThread(UpdaterProc, m_hWnd); } LRESULT CSomeClass::OnUser(WPARAM wParam, LPARAM lParam) { // Обработать сообщение return 0; }
|