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

C / C++ / MFC

 
AnswerRe: SetWindowsHookEx failed Pin
leon de boer13-Jan-20 12:49
Memberleon de boer13-Jan-20 12:49 
GeneralRe: SetWindowsHookEx failed Pin
Member 1410515513-Jan-20 16:51
MemberMember 1410515513-Jan-20 16:51 
GeneralRe: SetWindowsHookEx failed Pin
Richard MacCutchan13-Jan-20 23:35
communityengineerRichard MacCutchan13-Jan-20 23:35 
GeneralRe: SetWindowsHookEx failed Pin
Member 1410515514-Jan-20 1:34
MemberMember 1410515514-Jan-20 1:34 
GeneralRe: SetWindowsHookEx failed Pin
Richard MacCutchan14-Jan-20 1:47
communityengineerRichard MacCutchan14-Jan-20 1:47 
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 
I use this code:

Quote:
BOOL C1095C::IsFileReady(CString path)
{
HANDLE hFile = CreateFile(path.GetBuffer(), GENERIC_READ, FILE_SHARE_WRITE | FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);

if (hFile == INVALID_HANDLE_VALUE)
{
return FALSE;
}
else
{
CloseHandle(hFile);
return TRUE;
}
}


while (!IsFileReady(output.GetBuffer()))
{
Sleep(1);
}

which waits for a file to be created and then once it is, it
proceeds to the next job. The problem is, this code doesnt seem to
work every time. Im nervous now in using it. I need to wait for a
file to be full created and sometimes it may take 5+ minutes. Once its
created, then I want to move onto the next step. How can I adjust this
code to make it work every time? Please any response any one can give me
will be great appreciated.
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 
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 

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.