RE: thread & dialog based application
- From: Victor <Victor@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 11 Aug 2008 02:43:02 -0700
You may not directly access main thread window controls from within any other
thread. Instead you should PostMessage user defined messages to notify the
main thread that it has to change something (edit control content) in your
case.
Check out this Joe's essay "Using Working Threads":
http://www.flounder.com/workerthreads.htm
Victor
"wojjed@xxxxxxxxx" wrote:
Hi.
I want my threads to write some text in edit boxes, but i got no idea
how to get access to control values of that boxes.. Thread is
declareted in main dialog class.
I mean my thread is :
UINT __cdecl threadA(LPVOID pParams)
{
struct userInterface * ptr;
ptr = (struct userInterface *) pParams;
for(;;)
{
WaitForSingleObject(bFnsz,INFINITE);
ptr ->strTh1 = ( _T("AAA "));
m_th1.ReplaceSel(ptr ->strTh1); // Here i got error. m_th1 is
declareted in main dialog class.
ReleaseSemaphore(aFnsz,1,NULL);
}
return 0;
}
thx in advance for help
- References:
- thread & dialog based application
- From: wojjed
- thread & dialog based application
- Prev by Date: RE: How to get the size of an icon?
- Next by Date: CMFCCustomizeButton::m_bIgnoreLargeIconsMode
- Previous by thread: thread & dialog based application
- Next by thread: CMFCCustomizeButton::m_bIgnoreLargeIconsMode
- Index(es):
Relevant Pages
|