Re: Waiting to thread exit



"Sebastian Warmuz" <sebastian@xxxxxxxxxxx> wrote in message news:%23Qol0Jv8HHA.4432@xxxxxxxxxxxxxxxxxxxxxxx
Thx Scott And Joseph.

Sorry for my stupid questions but I already started to learn threads. I made everythign like You said and now everything works fine. But I have only one small problem....

In the method I am creating a therad I have to obtain that thread is finished. This thread will make a backup of some files and after job is done it will continue to lauch application
void CMyApp::OnInitInstance()
{
// 1. init etc,
// 2. make backup in thread displaying progress
// 3. if backup made do the res
}

But the problem is that point 3 is started when backup thread is not yet finished.... How o resolve it ?

No, not "in the method." Windows programs must be event-driven and continue to process messages so the GUI will operate properly. Every method in the main thread must return quickly. So you cannot wait in the main thread until the new thread is finished: This would cause to program to fail to repaint properly and to be labeled "not responding" by Windows.

What we suggested is that you post a message to the main window when the backup copy thread is finished. When you get that messsage then you can "do the res".

.



Relevant Pages

  • NewestShareware.com Issue #160
    ... Program Name - Supported Platforms - Type - Category ... Vista Smoker Pro - Windows Vista - Utilities ... Ahsay Offsite Backup Server - All - Commercial ... Download file size: 1308 K ...
    (comp.software.shareware.announce)
  • Re: Folder security. FAT to ntfs?
    ... it is recommended you backup your critical ... a clean system BEFORE you start.. ... What to Know Before You Download and Install Windows XP Service Pack 2 ... application, Disk copier, etc.) You'll be glad to know that if you have ...
    (microsoft.public.windowsxp.general)
  • Re: cant disable lycos side search, please help
    ... Locate all of the software (the installation media - CDs, ... application, Disk copier, etc.) You'll be glad to know that if you have ... using Windows XP "prettifications". ... use the backup tool that comes with Windows XP: ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: In the Shallow End
    ... by the compiler when it targets a new architecture. ... Once you understand how unix works, ... there that even Windows hasn't got. ... have no idea what a backup is. ...
    (comp.sys.mac.advocacy)
  • RE: Backup and other Questions
    ... computerized for windows xp pro. ... The registry Event logs,System files, otherwise known as the registry. ... A volume is a (hard disk, or cdrw drive or dvd drive ect,, ... Now regisry items you backup include application regisry items too,(your ...
    (microsoft.public.windowsxp.perform_maintain)

Loading