Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. header file not being read (resource.h)

header file not being read (resource.h)

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutoriallearning
6 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    ForNow
    wrote on last edited by
    #1

    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"

    Mircea NeacsuM 1 Reply Last reply
    0
    • F ForNow

      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"

      Mircea NeacsuM Offline
      Mircea NeacsuM Offline
      Mircea Neacsu
      wrote on last edited by
      #2

      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

      F 1 Reply Last reply
      0
      • Mircea NeacsuM Mircea Neacsu

        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

        F Offline
        F Offline
        ForNow
        wrote on last edited by
        #3

        you are correct however when I right click on the file in solution explorer dont see rescan

        F 1 Reply Last reply
        0
        • F ForNow

          you are correct however when I right click on the file in solution explorer dont see rescan

          F Offline
          F Offline
          ForNow
          wrote on last edited by
          #4

          I got it right click on the actual file I see rescan -> rescan file however didnt work

          Mircea NeacsuM 1 Reply Last reply
          0
          • F ForNow

            I got it right click on the actual file I see rescan -> rescan file however didnt work

            Mircea NeacsuM Offline
            Mircea NeacsuM Offline
            Mircea Neacsu
            wrote on last edited by
            #5

            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

            F 1 Reply Last reply
            0
            • Mircea NeacsuM Mircea Neacsu

              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

              F Offline
              F Offline
              ForNow
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups