Re: How to force a file load?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



If you re-read the file, you'll get the most recent copy of it. I suspect
you just keep the file in memory.
Make sure also you properly close the file when you're done reading it.

"nap" <gospam@xxxxxxxxxxxx> wrote in message
news:WW3ne.845$wy1.454@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Thanks Jonathan'
>
> This code doesn't address my issue. I suspect it has to do with Window's
> caching the file. The code you have posted simply closes a doc and repoens
> it with the same file name. The same issue could concievably occur in that
> code I suppose. .
>
> I am using the CFile api.
>
>
> "Jonathan Wood" <jwood@xxxxxxxxxxxxxxxx> wrote in message
> news:OnqjaohZFHA.2996@xxxxxxxxxxxxxxxxxxxxxxx
>> My routine simply replaces the current file with the one on the disk with
>> the same name.
>>
>> If you want to load a file from disk with the same name as the file being
>> edited, then it should do exactly what you want.
>>
>> --
>> Jonathan Wood
>> SoftCircuits
>> http://www.softcircuits.com
>> Available for consulting: http://www.softcircuits.com/jwood/resume.htm
>>
>> "nap" <gospam@xxxxxxxxxxxx> wrote in message
>> news:VK2ne.23227$J12.19166@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>> Thanks Jonathin. I am not sure I understand how this code would help.
>>>
>>> My problem is that Windows thinks the file is already loaded as people
>> reuse
>>> the file name for new versions of the file. I want my app to load from
>> disk
>>> regardless. .
>>>
>>> I am using the CFile api.
>>>
>>> Thanks again
>>>
>>> eng@em
>>>
>>>
>>>
>>> "Jonathan Wood" <jwood@xxxxxxxxxxxxxxxx> wrote in message
>>> news:O6SAtegZFHA.1152@xxxxxxxxxxxxxxxxxxxxxxx
>>> >I added a File|Reload command that looks like this:
>>> >
>>> > //
>>> > void CMyAppDoc::OnFileReload()
>>> > {
>>> > CString sFile;
>>> > BOOL bIsModified;
>>> >
>>> > sFile = GetPathName();
>>> > if (sFile.IsEmpty())
>>> > {
>>> > // Note that currently this command gets disabled if there is no
>>> > // filename but we'll keep this here just in case.
>>> > AfxMessageBox(_T("Cannot reload this file because no filename is
>>> > associated with the current window."));
>>> > }
>>> > else {
>>> > bIsModified = IsModified();
>>> > if (bIsModified)
>>> > {
>>> > if (AfxMessageBox(_T("WARNING: This file will be reloaded from
>>> > disk
>>> > and ")
>>> > _T("all of your unsaved changes to this file will be
>>> > lost!\n\n")
>>> > _T("Are you sure this is what you want to do?"),
>>> > MB_YESNO|MB_ICONEXCLAMATION, ID_FILE_RELOAD) == IDYES)
>>> > bIsModified = FALSE;
>>> > }
>>> > if (bIsModified == FALSE)
>>> > {
>>> > OnCloseDocument();
>>> > AfxGetApp()->OpenDocumentFile(sFile);
>>> > }
>>> > }
>>> > }
>>> >
>>> >
>>> > --
>>> > Jonathan Wood
>>> > SoftCircuits
>>> > http://www.softcircuits.com
>>> > Available for consulting: http://www.softcircuits.com/jwood/resume.htm
>>> >
>>> > "eng@em" <noemail@xxxxxxx> wrote in message
>>> > news:LT0ne.647$IE7.16@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>> >> I have an app I've wrritten in MFC which loads I2C EEProms through a
>> USB
>>> >> device. I have one user who is loading a file with the same name
>>> > repeatedly
>>> >> as he changes DSP settings for this device. But the app is (caching?)
>> the
>>> >> file and will send old data. I have asked him to use new names for
>>> >> now
>>> > but..
>>> >> what is the solution to this? Is there something I need to do to
>>> >> force
>>> >> the
>>> >> load of the file?
>>> >>
>>> >> thanks
>>> >>
>>> >> eng@em
>>> >>
>>> >>
>>> >
>>> >
>>>
>>>
>>
>>
>
>


.



Relevant Pages

  • Re: Is a 10 minute reboot normal?
    ... load) & A/V ... I suspect my disk is a bit slow... ...
    (microsoft.public.windowsxp.general)
  • Re: XP cant see 2nd drive
    ... If DOS wont let you change to the C:\ drive then I would suspect the drive ... booting using a floppy disk, connect only the suspect drive and boot ... You can create it from windows if you have a floppy disk drive. ...
    (microsoft.public.windowsxp.help_and_support)
  • OTish: Odd problem with reading data from CD drives
    ... files can be seen on the disk. ... and to test I removed it from "system" and let Windows ... redetect it. ... It looks as if there is more general fault, and I'm beginning to suspect that there ...
    (uk.comp.homebuilt)
  • Re: Disk troubleshooter?
    ... when boinking - it doesn't actually fail. ... That's why I wanted to work out whether it *was* suspect or not. ... to waste money comfirming the feckedness instead of just spending the ... than any smaller disk. ...
    (uk.comp.sys.mac)
  • Re: Trying to Load Ubuntu 11.04 onto HP Laptop. Failed at reboot
    ... I suspect he has a disk with a jumper set to slave, ...
    (Ubuntu)