|
I cannot use flushfilebuffer function because it is already opened for write access by third party software. I can only read it
Trioum
|
|
|
|
|
trioum wrote: I cannot use flushfilebuffer function because it is already opened for write access by third party software.
Sure you can.
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;
}
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
|
|
|
|
|
Thanks for I will R&D and let you know
Trioum
|
|
|
|
|
No it is not working as I want . What I do I open a note pad in c drive and type something . and the run your code by specifying "c" drive .code run successfully but data in notepad not saved .according to you data in notepad must be saved???.
Trioum
|
|
|
|
|
You lost me here. Why are we suddenly talking about notepad? Based on prior thread posts I thought you had problems flushing an XML file from a third-party software.
trioum wrote: but data in notepad not saved .according to you data in notepad must be saved???.
What are you asking here? Are you actually asking me why text in notepad memory is not being saved to disk when you flush the mounted volume?
Unfortunately I do not think we are on the same level here.
Good Luck,
-David Delaune
|
|
|
|
|
I first check with xml file is it not working then with text file . in both it is not working
Trioum
|
|
|
|
|
Hello.
I am using ::SHEmptyRecycleBin(NULL, NULL, SHERB_NOCONFIRMATION|SHERB_NOPROGRESSUI|SHERB_NOSOUND);
to empty recycle bin in a utility that checks the various aspects of a PC like if antivirus is installed or not, firewall enabled or not etc. To empty recycle bin I use the above call. I have included "shellapi.h" and that's all.
Am I missing something? I thought this is all I need to do. I am using VS2005.
Regards.
|
|
|
|
|
I think yes.. if you wnat more information check the link[^]
|
|
|
|
|
Could not really see where I made a mistake. Reading that article - well, I did that before I posted here. But still I reread it. Still lost.
Regards.
|
|
|
|
|
What is real issue?
Величие не Бога может быть недооценена.
|
|
|
|
|
Getting a return value of E_NOINTERFACE when I was expecting S_OK. I know, I made a mistake. Now where is it? That's the question I am trying to solve.
Regards.
|
|
|
|
|
Hi,
My code is as below
MEMORYSTATUSEX msex;
GlobalMemoryStatusEx(&msex);
DWORD dwBytesPerMB = 1024 * 1024;
m_RAM = (float)msex.ullTotalPhys / (float)dwBytesPerMB;
m_RAM = (float) ( m_RAM * 1.01 ); (Getting compilation error at this point)
Can I know how to fix this..
Thanks...
|
|
|
|
|
It would help a lot if you could tell us the types of the different variables that you are using in your code snippet.
On the other hand, did you try what the compiler suggested you: using a signed __int64 instead of an unsigned __int64 ?
|
|
|
|
|
The implication from the error message you've posted is that m_RAM has type unsigned __int64 (it'll try to convert it to double when you multiply by 1.01).
You could either a) change the type of m_RAM to signed __int64 (as indicated by the error message), or b) alter the expression causing the error. How about:
m_RAM = m_RAM + (m_RAM / 100); ?
That might not give exactly the same result, but it'll probably be close enough!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
Good morning ,
brief question. Has anybody experience with RTP?
I got an RTP engine working already but don´t know how exactly the timestamp property is set in the RTP header. Usually an RTP header is 12 byte long with bytes 3-7 being the timestamp. But how exactly is the timestamp (system time?) stored in these 4 bytes? Is there a certain specification about it? Or totally up to me? Like the accuracy of time and little or big endian?
Thanks.
Souldrift
|
|
|
|
|
Looking at the spec[^], it seems to me that the timestamp format is left to be defined by your application.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hello All
I have a file as "Sample.mc" copied from the below link.....
http://msdn.microsoft.com/en-us/library/bb540476(VS.85).aspx[^]
These r some rules mentioned on the above page how to build this file,
Build the message DLL from Sample.mc using the following steps:
1. mc -U sample.mc
2. rc -r sample.rc
3. link -dll -noentry -out:sample.dll sample.res
but i want to know where and how to apply these rules...
i am using Vs 2005 VC++(Win32 API)....
Any suggestion is highly appreciated
Thanks
|
|
|
|
|
|
Thanks Garth J Lancaster!!!
it was a great article. I got my work Done ...
Thanks
|
|
|
|
|
For supporting Tab key navigation through controls in the popup dialog created in an OCX, I have implemented the message hook as described in Microsoft Help and Support Article ID: 187988[^]
Now the IME for Japanese is not working fine. When the IME is enabled for input as Hiragana (or something), there is no proper result. I found that this is because the keyboard message is always altered in the hook procedure.
Do anybody have come such a scenario and found a solution?
Thank you.
- ns ami -
|
|
|
|
|
I want to Validate a EditBox only number entry, including (+ or - values).I used SpanIncluding function of CString. my code is
CString value;
value=m_strEditBox.SpanIncluding ("0123456789-+");
if(!(value==m_strEditBox && value.GetLength ()==m_strEditBox.GetLength ()))
{
MessageBox(_T("Invalid Entry"),MB_OK,MB_ICONINFORMATION);
return;
}
it works fine only when user enters like -10 or +15.
But if user enters wrong value like 10- or -14- or +15-20 or ----- or +++++ for this type of values entry ,the above condition will not work it will not fire the error Message like Invalid Entry.For this i am getting strange output so how to restrict or validate for this type of entry in EditBox.Help me. Thanks in Advance.
|
|
|
|
|
Check this link below [^]
|
|
|
|
|
Hello Friends
I want to display thumbails for my Files in the same way as windows does for .jpeg and other bitmap images.
I want to know how windows display them means it uses some bitmap images or some dtabase to display them.
I m having all the bitmap data that i want to display as thumbnail for my files but how do i use that windows display them as thumbnail?
Thanks in Advance
Regards
Yogesh
|
|
|
|
|
Use a CListCtrl and set as icons(LVS_ICON), now you can show the thumbnail image.
Величие не Бога может быть недооценена.
|
|
|
|