RE: thread & dialog based application

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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

.



Relevant Pages

  • Re: Why are get/set properties useful?
    ... public, you can control what data goes into them, and how the data is ... can make sure a string will fit into a database field before you allow it to ... directly access a variable, but why is that so useful? ...
    (microsoft.public.dotnet.languages.csharp)
  • Direct control of the usb data line drivers
    ... is there any possibility to directly access the usb D+/D- line drivers? ... How may I control there features directly, it is possible to disable the hardware-implemented usb-protocoll, especially in the uhci 1.1 host controller chips? ...
    (comp.os.linux.hardware)
  • Re: set several menuitems.visible=true
    ... because i can't directly access ToolStripMenuItem.DropDownItems? ... what control owns them, the menu items should appear in the control ... reference the dictionary to set the visibility. ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Parallel port accesses _outp
    ... I have an old dialog based app that uses _outp and _inp to directly access ... the parallel port registers. ... I am using the control lines of LPT1 to control ...
    (microsoft.public.vc.language)
  • Re: AOL
    ... The cable companies OWN and CONTROL anything with THEIR IP addresses. ... but the IP address belongs to the cable company and since ... PTR record so the new IP you got will now reflect YOUR mail server. ...
    (microsoft.public.windows.server.sbs)