Re: Waiting for Dialog to update in a Nnew Thread

Tech-Archive recommends: Speed Up your PC by fixing your registry



Thank's David, I tried it on one function and got rid of all of the _this->
prefixes, and the progress box updates on screen properly.

Now I just have to work out how to do one thing after another if one or both
are not in the main thread. The prevailing wisdom is that I should not use
an Event, so what do I do?

Alan

"David Wilkinson" <no-reply@xxxxxxxxxxxx> wrote in message
news:OO5X39s4FHA.4076@xxxxxxxxxxxxxxxxxxxxxxx
> Alan Hadley wrote:
>
>> Messy in the method I used, I rewrote the calculation functions so that
>> they could be started with AfxBeginThread and passed 'this' as the
>> parameter, then copied the parameter to a variable CCombineDoc
>> _this=param. then accessed the data which lives in my document class
>> with statements like _this->x. This has left all of my calculation
>> functions with a lot of _this-> thingies cluttering the code and whenever
>> I change anything I have to remember to include them or get loads of
>> error messages. So if I start a new thread for a calculation how do I
>> get at the data in my document class there is a lot of it, if I try to
>> access it directly I get error messages?
>
> What I always do is have the static thread function use its LPVOID
> parmeter to immediately call a non-static member of the class. Then you
> have what you really wanted -- a non-static thread function.
>
> And as others have told you always leave all the GUI in the main thread.
> Personally I use SendMessage to update the main thread from the worker
> thread, but you do need to be careful not to do anything in the main
> thread that could cause a blocking situation.
>
> David Wilkinson


.



Relevant Pages

  • Re: Unable to apply Office 2003 Updates --- BINGO
    ... You da man, Chad! ... Step 1 of your advice led to a fix within minutes. ... >look for more error messages in Event ... >> to apply the most recent Microsoft Office Updates. ...
    (microsoft.public.officeupdate)
  • Re: MSVCR80.DLL Error Messages
    ... I've just installed the latest critical updates from Windows Update, ... As soon as I did this, I started to get error messages popping up, when I ... If it was originally part of Windows 2000, ... would not be backed up for the uninstall procedures. ...
    (microsoft.public.windowsupdate)
  • Re: sfc problems?
    ... Our software updates are downloaded and installed via a WSUS server on our ... I test them first before approving the downloads. ... > chance to record all Stop Error Messages. ... Use sigverif to determine which drivers are unsigned (this approach ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: clean reinstall questions
    ... "david" wrote in message ... His computer has no updates and update ... >> 2004 Windows MVP "Winny" Award ... He has the reinstall disk and I have the ms security update ...
    (microsoft.public.windowsxp.general)
  • .net updates errors
    ... I also had error messages and downloaded files to remove previous beta versions, removing earlier .Net Versions in Control Panel, clean up utility etc... ... i keep getting lately the same updates notifications about the next .net ... anything of the .net framework (using the add/remove window and then the MS ...
    (microsoft.public.windowsupdate)