|
What does it have to do with notepad ? If your third party software updates the file directly, then there's nothing to do with notepad here.
Are you sure you read your data correctly ?
|
|
|
|
|
yes I read it correctly I open it as fopen("file.xml",rb);
Trioum
|
|
|
|
|
But what does notepad have to do here ? I guess your third party software saves the file directly, it doesn't use notepad to "save its data" ?
trioum wrote: yes I read it correctly I open it as fopen("file.xml",rb);
That doesn't mean that you are reading it correctly afterwards. It is also possible that your third party program is unable to write the data to the file because you still have the file open.
|
|
|
|
|
Cedric Moonen wrote: But what does notepad have to do here ?
Nothing. You mentioned it first (as an example), and the OP just concurred.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
He was talking about a program in which he was writing the text file and saving it. Notepad was just an example but I don't know what this program (being notepad or whatever else) has something to do with the question...
|
|
|
|
|
Hello trioum,
When an application is modifying disk clusters at a very high speed... the NT Cache Manager could buffer these disk changes to avoid thrashing the drive. You can call the FlushFileBuffers Function[^] and flush the buffers associated with the handle. Another option is to open the file with FILE_FLAG_WRITE_THROUGH and FILE_FLAG_NO_BUFFERING to ask the cache manager to disable buffering.
INFO: FILE_FLAG_WRITE_THROUGH and FILE_FLAG_NO_BUFFERING[^]
You should be aware that these CreateFile flags can have an enormous negative impact on disk performance.
Best Wishes,
-David Delaune
|
|
|
|
|
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
|
|
|
|
|