Click here to Skip to main content
14,425,800 members

C / C++ / MFC

 
GeneralRe: SetWindowsHookEx failed Pin
Member 1410515514-Jan-20 17:43
MemberMember 1410515514-Jan-20 17:43 
GeneralRe: SetWindowsHookEx failed Pin
Richard MacCutchan14-Jan-20 22:40
communityengineerRichard MacCutchan14-Jan-20 22:40 
QuestionIsFileReady Pin
Erich Ruth12-Jan-20 14:34
MemberErich Ruth12-Jan-20 14:34 
AnswerRe: IsFileReady Pin
leon de boer12-Jan-20 15:52
Memberleon de boer12-Jan-20 15:52 
AnswerRe: IsFileReady Pin
Stefan_Lang13-Jan-20 0:21
mveStefan_Lang13-Jan-20 0:21 
GeneralRe: IsFileReady Pin
leon de boer13-Jan-20 0:52
Memberleon de boer13-Jan-20 0:52 
SuggestionRe: IsFileReady Pin
David Crow13-Jan-20 6:02
MemberDavid Crow13-Jan-20 6:02 
AnswerRe: IsFileReady Pin
Daniel Pfeffer14-Jan-20 0:38
professionalDaniel Pfeffer14-Jan-20 0:38 
If you are waiting for the file to be fully created (i.e. completely written), then this code won't work. At best, it will wait until the file is created (i.e. when the other task opens it for writing).

The problem may be broken into two steps:
  1. Wait until the file is created (i.e. it appears in the directory)
  2. Wait until the file is closed (i.e. the writing is completed)
Others have given you good ideas about how to wait for the file to be created. In order to wait for the file to be completely written, the best way would be for the other application to create another file AFTER it is done with the data file. For example:
  1. Your application waits for the creation of DATA.DAT
  2. Other application creates file DATA.DAT (your application detects the creation)
  3. Other application writes into DATA.DATA (your application waits for the creation of FINISHED.DAT)
  4. Other application closes DATA.DAT
  5. Other application creates FINISHED.DAT (your application detects FINISHED.DAT, and knows that DATA.DAT is ready)
There are some other points to handle (e.g. what happens if DATA.DAT is created before your application starts waiting for it?), but this is the basic idea.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.

GeneralRe: IsFileReady Pin
Joe Woodbury14-Jan-20 21:15
professionalJoe Woodbury14-Jan-20 21:15 
GeneralRe: IsFileReady Pin
Daniel Pfeffer14-Jan-20 21:58
professionalDaniel Pfeffer14-Jan-20 21:58 
QuestionVeteran VS2008 users here? Ever lost your debug functions? Pin
charlieg9-Jan-20 2:59
Membercharlieg9-Jan-20 2:59 
AnswerRe: Veteran VS2008 users here? Ever lost your debug functions? Pin
Afzaal Ahmad Zeeshan9-Jan-20 23:28
mvaAfzaal Ahmad Zeeshan9-Jan-20 23:28 
GeneralRe: Veteran VS2008 users here? Ever lost your debug functions? Pin
charlieg10-Jan-20 4:51
Membercharlieg10-Jan-20 4:51 
AnswerRe: Veteran VS2008 users here? Ever lost your debug functions? Pin
phil.o9-Jan-20 23:46
mvephil.o9-Jan-20 23:46 
GeneralRe: Veteran VS2008 users here? Ever lost your debug functions? Pin
charlieg10-Jan-20 4:53
Membercharlieg10-Jan-20 4:53 
AnswerRe: Veteran VS2008 users here? Ever lost your debug functions? Pin
_Flaviu10-Jan-20 0:19
Member_Flaviu10-Jan-20 0:19 
GeneralRe: Veteran VS2008 users here? Ever lost your debug functions? Pin
charlieg10-Jan-20 4:58
Membercharlieg10-Jan-20 4:58 
AnswerRe: Veteran VS2008 users here? Ever lost your debug functions? Pin
charlieg10-Jan-20 5:15
Membercharlieg10-Jan-20 5:15 
AnswerRe: Veteran VS2008 users here? Ever lost your debug functions? Pin
charlieg21-Jan-20 12:53
Membercharlieg21-Jan-20 12:53 
Questionsrandom and random Pin
_Flaviu9-Jan-20 1:44
Member_Flaviu9-Jan-20 1:44 
AnswerRe: srandom and random Pin
phil.o9-Jan-20 2:03
mvephil.o9-Jan-20 2:03 
GeneralRe: srandom and random Pin
_Flaviu9-Jan-20 3:29
Member_Flaviu9-Jan-20 3:29 
AnswerRe: srandom and random Pin
Richard MacCutchan9-Jan-20 2:26
communityengineerRichard MacCutchan9-Jan-20 2:26 
SuggestionRe: srandom and random Pin
David Crow9-Jan-20 4:25
MemberDavid Crow9-Jan-20 4:25 
GeneralRe: srandom and random Pin
_Flaviu9-Jan-20 7:42
Member_Flaviu9-Jan-20 7:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.