Link to home
Start Free TrialLog in
Avatar of apostrophe27
apostrophe27

asked on

Update dialog box from thread outside class



I need to access a dialog box from a thread outside of the dialog box class.

in portai.cpp, the thread is called like this:
m_pReaderThread = AfxBeginThread(ReaderThread, (LPVOID)this);

m_pReaderThread is declared like this in portai.h  CWinThread* m_pReaderThread;      
and the thread is declared as UINT CiPortAI::ReaderThread(LPVOID pThis)

I want to be able to update text boxes on my main dialog box from within the thread. How do I do this?
Avatar of vachooho
vachooho
Flag of United States of America image

cast LPVOID pThis to the class from which it was called ()pThis
ASKER CERTIFIED SOLUTION
Avatar of alb66
alb66
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of apostrophe27
apostrophe27

ASKER

Excellent!

It worked, and I learned about worker threads. Thanks.