Re: How to force a file load?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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: Mobile Development for WM 5 with one main exe controlling mult
    ... I'm trying to convince them with what you said about the load strategy, ... it could be due to the fact that all the loading are done ... App size has nothing ... split the whole program from one exe to multiple. ...
    (microsoft.public.pocketpc.developer)
  • Re: Reprise: Pended IOCtrl + LoadLibrary == Deadlock?
    ... >3) launching msdev.exe from the shell and from within windbg. ... >load (from within msdev) ionwizrd.exe ... When I hit F5 to run my app the following occurs: ...
    (microsoft.public.development.device.drivers)
  • Re: Whose Fish?
    ... That would be much more in line with your Table Oriented Programming ... cart structure/object floating around in the app. ... intuitive way, as it is with a good object model, ... I might load CustomerInfo with read only ID ...
    (comp.object)
  • Re: Reprise: Pended IOCtrl + LoadLibrary == Deadlock?
    ... > and execute!htrace in both devenv.exe and the target app. ... launching msdev.exe from the shell and from within windbg. ... All other cases either result in not being able to run msdev or my app ... itself both when it starts up and when it is trying to load my app. ...
    (microsoft.public.development.device.drivers)
  • Re: Dynamically-created menus and mdi children
    ... I created the new app and it worked. ... my main form is not the first form that opens. ... I open the Main Form and close the Login form. ... Otherwise my main form continues to load and I load ...
    (microsoft.public.dotnet.languages.vb)