Click here to Skip to main content
15,891,920 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: SetWindowsHookEx failed Pin
leon de boer13-Jan-20 11:49
leon de boer13-Jan-20 11:49 
GeneralRe: SetWindowsHookEx failed Pin
Member 1410515513-Jan-20 15:51
Member 1410515513-Jan-20 15:51 
GeneralRe: SetWindowsHookEx failed Pin
Richard MacCutchan13-Jan-20 22:35
mveRichard MacCutchan13-Jan-20 22:35 
GeneralRe: SetWindowsHookEx failed Pin
Member 1410515514-Jan-20 0:34
Member 1410515514-Jan-20 0:34 
GeneralRe: SetWindowsHookEx failed Pin
Richard MacCutchan14-Jan-20 0:47
mveRichard MacCutchan14-Jan-20 0:47 
GeneralRe: SetWindowsHookEx failed Pin
Member 1410515514-Jan-20 16:43
Member 1410515514-Jan-20 16:43 
GeneralRe: SetWindowsHookEx failed Pin
Richard MacCutchan14-Jan-20 21:40
mveRichard MacCutchan14-Jan-20 21:40 
QuestionIsFileReady Pin
Erich Ruth12-Jan-20 13:34
Erich Ruth12-Jan-20 13: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 14:52
leon de boer12-Jan-20 14:52 
AnswerRe: IsFileReady Pin
Stefan_Lang12-Jan-20 23:21
Stefan_Lang12-Jan-20 23:21 
GeneralRe: IsFileReady Pin
leon de boer12-Jan-20 23:52
leon de boer12-Jan-20 23:52 
SuggestionRe: IsFileReady Pin
David Crow13-Jan-20 5:02
David Crow13-Jan-20 5:02 
AnswerRe: IsFileReady Pin
Daniel Pfeffer13-Jan-20 23:38
professionalDaniel Pfeffer13-Jan-20 23:38 
GeneralRe: IsFileReady Pin
Joe Woodbury14-Jan-20 20:15
professionalJoe Woodbury14-Jan-20 20:15 
GeneralRe: IsFileReady Pin
Daniel Pfeffer14-Jan-20 20:58
professionalDaniel Pfeffer14-Jan-20 20:58 
QuestionVeteran VS2008 users here? Ever lost your debug functions? Pin
charlieg9-Jan-20 1:59
charlieg9-Jan-20 1:59 
AnswerRe: Veteran VS2008 users here? Ever lost your debug functions? Pin
Afzaal Ahmad Zeeshan9-Jan-20 22:28
professionalAfzaal Ahmad Zeeshan9-Jan-20 22:28 
GeneralRe: Veteran VS2008 users here? Ever lost your debug functions? Pin
charlieg10-Jan-20 3:51
charlieg10-Jan-20 3:51 
AnswerRe: Veteran VS2008 users here? Ever lost your debug functions? Pin
phil.o9-Jan-20 22:46
professionalphil.o9-Jan-20 22:46 
GeneralRe: Veteran VS2008 users here? Ever lost your debug functions? Pin
charlieg10-Jan-20 3:53
charlieg10-Jan-20 3:53 
AnswerRe: Veteran VS2008 users here? Ever lost your debug functions? Pin
_Flaviu9-Jan-20 23:19
_Flaviu9-Jan-20 23:19 
GeneralRe: Veteran VS2008 users here? Ever lost your debug functions? Pin
charlieg10-Jan-20 3:58
charlieg10-Jan-20 3:58 
AnswerRe: Veteran VS2008 users here? Ever lost your debug functions? Pin
charlieg10-Jan-20 4:15
charlieg10-Jan-20 4:15 
AnswerRe: Veteran VS2008 users here? Ever lost your debug functions? Pin
charlieg21-Jan-20 11:53
charlieg21-Jan-20 11:53 
Questionsrandom and random Pin
_Flaviu9-Jan-20 0:44
_Flaviu9-Jan-20 0: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.