header file not being read (resource.h)
-
Hi I have a header file which is not being read. It happens to be the resource.h. its in the same directory where all of my headers are as an example I defining three controls in my modal dialog box defining and validating them thru DDX/DDV 2 out of the 3 get the siguligly red underline When I copy the #define to the .cpp file it goes away even more strange my .rc file recognizes the #defines when I #include "resource.h"
-
Hi I have a header file which is not being read. It happens to be the resource.h. its in the same directory where all of my headers are as an example I defining three controls in my modal dialog box defining and validating them thru DDX/DDV 2 out of the 3 get the siguligly red underline When I copy the #define to the .cpp file it goes away even more strange my .rc file recognizes the #defines when I #include "resource.h"
I bet it has a comment line
//{{NO_DEPENDENCIES}}
at the very beginning. If so, IntelliSense will not reload the file every time it changes. For more details see: TN035: Using Multiple Resource Files and Header Files with Visual C++ | Microsoft Docs[^]
Quote:
Visual C++, circumvents the dependency on RESOURCE.H by including the following comment as the first line of the RESOURCE.H file: h //{{NO_DEPENDENCIES}} The development environment interprets this comment by ignoring the changes to RESOURCE.H so that dependent .CPP files will not need to be recompiled.
The quick fix is to right-click on the file and select "Rescan > Rescan File"
Mircea
-
I bet it has a comment line
//{{NO_DEPENDENCIES}}
at the very beginning. If so, IntelliSense will not reload the file every time it changes. For more details see: TN035: Using Multiple Resource Files and Header Files with Visual C++ | Microsoft Docs[^]
Quote:
Visual C++, circumvents the dependency on RESOURCE.H by including the following comment as the first line of the RESOURCE.H file: h //{{NO_DEPENDENCIES}} The development environment interprets this comment by ignoring the changes to RESOURCE.H so that dependent .CPP files will not need to be recompiled.
The quick fix is to right-click on the file and select "Rescan > Rescan File"
Mircea
-
you are correct however when I right click on the file in solution explorer dont see rescan
-
Hmm, might be related to the VS version. I'm on VS2019 16.11.8 and just checked: every change in the .h file (comment and uncomment a symbol the .h file) is immediately reflected in the .cpp file although the .h file has
//{{NO_DEPENDENCIES}}
at the beginning. The only case where IntelliSense gets confused is if I revert changes ("Git > Undo Changes"). In this case however "Rescan" will pick-up the changes. OTOH I'm very sure I used to need "Rescan" for resource ID changes so maybe it's something that has recently changed in IntelliSense.Mircea
-
Hmm, might be related to the VS version. I'm on VS2019 16.11.8 and just checked: every change in the .h file (comment and uncomment a symbol the .h file) is immediately reflected in the .cpp file although the .h file has
//{{NO_DEPENDENCIES}}
at the beginning. The only case where IntelliSense gets confused is if I revert changes ("Git > Undo Changes"). In this case however "Rescan" will pick-up the changes. OTOH I'm very sure I used to need "Rescan" for resource ID changes so maybe it's something that has recently changed in IntelliSense.Mircea
I am on VS 2019 16.11.8 My windows program is a client to a z/os mainframe machine. I am down to the final component and I wrote a stand alone VS 2019 project because testing the code I building would require an ipl on the z/os machine most everytime What I am trying to say I am going to carry over these changes to my windows MFC client when I am done including copying over the .rc entries and resource.h file for some reason the that Project solution I dont run into this problem