Click here to Skip to main content
15,917,329 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Internal buffer of file Pin
Cedric Moonen10-Aug-09 0:59
Cedric Moonen10-Aug-09 0:59 
GeneralRe: Internal buffer of file Pin
trioum10-Aug-09 1:14
trioum10-Aug-09 1:14 
GeneralRe: Internal buffer of file Pin
Cedric Moonen10-Aug-09 1:27
Cedric Moonen10-Aug-09 1:27 
GeneralRe: Internal buffer of file Pin
David Crow10-Aug-09 2:44
David Crow10-Aug-09 2:44 
GeneralRe: Internal buffer of file Pin
Cedric Moonen10-Aug-09 2:48
Cedric Moonen10-Aug-09 2:48 
AnswerRe: Internal buffer of file Pin
Randor 10-Aug-09 7:38
professional Randor 10-Aug-09 7:38 
GeneralRe: Internal buffer of file Pin
trioum10-Aug-09 20:09
trioum10-Aug-09 20:09 
GeneralRe: Internal buffer of file Pin
Randor 10-Aug-09 23:33
professional Randor 10-Aug-09 23:33 
trioum wrote:
I cannot use flushfilebuffer function because it is already opened for write access by third party software.


Sure you can. Smile | :)

Here is a little professional tip that Mark Russinovich used to create his Sync v2.0[^] disk flusher.

BOOL FlushDiskDrive(TCHAR *szDrive)
{
	BOOL bRet = FALSE;
	HANDLE h = CreateFile(szDrive, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,0,NULL);
	if(INVALID_HANDLE_VALUE != h)
	{
		bRet = FlushFileBuffers(h);
		CloseHandle(h);
	}
	return bRet;
}
//Usage:
FlushDiskDrive(_T("\\\\.\\\\C:));


What we are doing here is opening the disk volume and flushing the entire volume cache. This code will not work for removable USB drives. This code also requires Administrator privileges. It is possible that a standard user with the FILE_FLAG_BACKUP_SEMANTICS permission may be able to use it, I am not certain and do not have time to test... I am leaving the office in a few minutes.

Let me know if this works for you.

Best Wishes,
-David Delaune
GeneralRe: Internal buffer of file Pin
trioum11-Aug-09 0:14
trioum11-Aug-09 0:14 
GeneralRe: Internal buffer of file Pin
trioum11-Aug-09 20:33
trioum11-Aug-09 20:33 
GeneralRe: Internal buffer of file Pin
Randor 11-Aug-09 21:23
professional Randor 11-Aug-09 21:23 
GeneralRe: Internal buffer of file Pin
trioum12-Aug-09 0:18
trioum12-Aug-09 0:18 
QuestionE_NOINTERFACE returned while using SHEmptyRecycleBin Pin
anjali_saluja9-Aug-09 23:09
anjali_saluja9-Aug-09 23:09 
AnswerRe: E_NOINTERFACE returned while using SHEmptyRecycleBin Pin
Chandrasekharan P9-Aug-09 23:25
Chandrasekharan P9-Aug-09 23:25 
GeneralRe: E_NOINTERFACE returned while using SHEmptyRecycleBin Pin
anjali_saluja10-Aug-09 3:30
anjali_saluja10-Aug-09 3:30 
QuestionRe: E_NOINTERFACE returned while using SHEmptyRecycleBin Pin
Adam Roderick J10-Aug-09 2:30
Adam Roderick J10-Aug-09 2:30 
AnswerRe: E_NOINTERFACE returned while using SHEmptyRecycleBin Pin
anjali_saluja10-Aug-09 3:31
anjali_saluja10-Aug-09 3:31 
Questionerror C2520: conversion from unsigned __int64 to double not implemented, use signed __int64 Pin
V K 29-Aug-09 22:41
V K 29-Aug-09 22:41 
AnswerRe: error C2520: conversion from unsigned __int64 to double not implemented, use signed __int64 Pin
Cedric Moonen9-Aug-09 23:53
Cedric Moonen9-Aug-09 23:53 
AnswerRe: error C2520: conversion from unsigned __int64 to double not implemented, use signed __int64 Pin
Stuart Dootson10-Aug-09 0:17
professionalStuart Dootson10-Aug-09 0:17 
AnswerRe: error C2520: conversion from unsigned __int64 to double not implemented, use signed __int64 Pin
Michael Schubert10-Aug-09 3:55
Michael Schubert10-Aug-09 3:55 
QuestionTimestamp of RTP header? Pin
Souldrift9-Aug-09 21:51
Souldrift9-Aug-09 21:51 
AnswerRe: Timestamp of RTP header? Pin
Stuart Dootson10-Aug-09 0:24
professionalStuart Dootson10-Aug-09 0:24 
QuestionHow to build .mc file Pin
Aabid9-Aug-09 20:42
Aabid9-Aug-09 20:42 
AnswerRe: How to build .mc file Pin
Garth J Lancaster9-Aug-09 21:34
professionalGarth J Lancaster9-Aug-09 21:34 

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.