Re: How to force a file load?



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: XP Pro OEM installs, Academic Upgrade doesnt
    ... He says I am NOT supposed to load ... the NVidia RAID driver if I have one disk. ... he also says that you can't use an "upgrade" version of Windows XP to ... > connectors but there is also the possibility that only certain connectors ...
    (microsoft.public.windowsxp.setup_deployment)
  • Re: SATA 3ware RAID review...sort of.
    ... indicate the load you are putting on the card or the harddrives. ... of sustained disk transfer. ... how many hits the server serves every second. ... >setup though so I was concerned about moving over to SATA for something ...
    (freebsd-isp)
  • Re: How to force a file load?
    ... > If you want to load a file from disk with the same name as the file being ... I want my app to load from ... >>> Jonathan Wood ... >>> SoftCircuits ...
    (microsoft.public.vc.mfc)
  • Re: Once and for all! Fastest way to load large jpeg
    ... - do you mean that a 4mb file is slow to load? ... but it could cut down on physical disk reads ... The above code is just creating a sort of emptyish Bitmap and shoving ... TMemoryStream then load the image from the TMemoryStream ...
    (alt.comp.lang.borland-delphi)
  • Re: "Load Balancing": How Busy are the servers?
    ... processes are waiting for disk. ... The fault columnshow how badly your system is accesing swap. ... If you look at swapinfo and you have a large amount of swap in use and then you see a high number in vmstat for fault, the machine is short on RAM for the load you have on it. ...
    (freebsd-questions)