Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a File ( with Sleep)

Status
Not open for further replies.

moonoo

Programmer
May 17, 2000
62
US
Hi ,
I am trying to open a File in C++ . But the File is prepared by a Batch and if the file is not there I want to sleep for a while and attempt again to open the File. But not infinitely ..I will try opening the File (say for 2 Minutes) and if still the File is not there , I want to exit after throwing an Error,
How do I implement this..
Regards
Dev
 
use CreateProcess to execute the batch and WaitForSingleObject to wait while betch is executed. You can specifi a timeout for WaitForSingleObject

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top