The information in this article applies to:
- Microsoft Visual C++, 32-bit Edition, versions 2.2, 4.0, 4.1, 4.2
- Microsoft FORTRAN PowerStation 32 for Windows NT, version 4.0
SYMPTOMS
Save All will not save a file loaded into the Developer's Studio editing
environment if all of the following are true:
- The loaded file is not modified in the editor.
- The copy of the file stored on disk is modified.
- The modified version is not reloaded.
Subsequent builds will use the version on disk that does not match the one
in the editor. Debugging will display in the loaded version, but the debug
information will be from the version on disk.
CAUSE
The Developer's Studio does not recognize that an unchanged file may need
to be saved. It assumes that this would have no effect, so the save does
not occur.
WORKAROUND
If a change you do not want occurs with an external file and you want the
local copy of the file to replace the one on disk, use Save rather than
Save All.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug was corrected in Visual C++
version 5.0.
MORE INFORMATION
Steps to Reproduce Problem
- Run Microsoft Developer's Studio, and load a project.
- Open a file containing code, but make no changes.
- On the Tools menu, click Options, and then click the Editor tab. Turn
off the 'Automatic reload of externally modified files' switch.
- Using the Notepad editor, load the same file you are editing in the
Developer's Studio. Introduce a compile time error, and save the file.
- Switch back to the Developer's Studio.
- Answer No when you're asked "This file has been modified outside the
source editor. Do you want to reload it?"
- On the File menu, click Save All. This should replace the modified file
on disk with the copy previously loaded into Developer's Studio, but it
does not.
- Build the project. The compiler will report the errors you introduced.
Click the error or press the F4 key to jump to a line in the file (which
does not contain the error) that is loaded in Developer's Studio.
Example Workaround
To work around the problem, replace step 7 with this:
- On the Window menu, select the file that was modified externally. Then
on the File menu, click Save. This will replace the modified copy on
disk with the copy currently loaded in the Developer's Studio.
|