PDA

View Full Version : Why won't WaitForSingleObject() wait for patch to finish running?


scs0
01-14-2002, 03:29 PM
I have an application that includes a Visual Patch patch as a resource. At a certain point in this program the resource is copied out to the harddrive where it is run by calling ShellExecuteEx() on it. After this, WaitForSingleObject() is called to wait for the patch to finish then the file is deleted.

When I run the program, WaitForSingleObject() fails to wait and the program continues before the patch has finished running. What's going on? Why doesn't VC++ recognize that the patch is running? Where does the problem exist?

I'm using VC++ 6.0 on a Windows 98-SE system and Visual Patch is version 1.0. The code works just fine if the app being run is Notepad instead of the patch.

Thanks

Mark
01-14-2002, 04:10 PM
Hi,

If you pass your Visual Patch executable the "/W" command line parameter when you execute it everything should work properly.

This command line option will force the Visual Patch launcher to wait until the entire update has completed before exiting.

mark.