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. VStudio setting to see macro expansion?

VStudio setting to see macro expansion?

Scheduled Pinned Locked Moved C / C++ / MFC
comquestion
10 Posts 3 Posters 0 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.
  • H Offline
    H Offline
    hiseldl
    wrote on last edited by
    #1

    I wrote a #define macro and I would like to see the output after it's preprocessed, is there a setting in VStudio that would show the macro after it is expanded? .dave. David Hisel -- http://www.hisel.com/

    T 1 Reply Last reply
    0
    • H hiseldl

      I wrote a #define macro and I would like to see the output after it's preprocessed, is there a setting in VStudio that would show the macro after it is expanded? .dave. David Hisel -- http://www.hisel.com/

      T Offline
      T Offline
      Tom Archer
      wrote on last edited by
      #2

      From the Property Pages dialog:

      1. Expand the Configuration folder
      2. Expand the C/C++ folder
      3. Click the Preprocessor item
      4. Change the Generate Preprossed File to the desired setting (line numbers or not in the output file)

      When you build the project, you will have preprocessed versions of your files with the .i extension. Cheers, Tom Archer Author, Inside C# A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.

      L H 2 Replies Last reply
      0
      • T Tom Archer

        From the Property Pages dialog:

        1. Expand the Configuration folder
        2. Expand the C/C++ folder
        3. Click the Preprocessor item
        4. Change the Generate Preprossed File to the desired setting (line numbers or not in the output file)

        When you build the project, you will have preprocessed versions of your files with the .i extension. Cheers, Tom Archer Author, Inside C# A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.

        L Offline
        L Offline
        lucy 0
        wrote on last edited by
        #3

        sorry, but didn't find item 4 (line numbers or not). should I include some C++ macros there?

        T 1 Reply Last reply
        0
        • L lucy 0

          sorry, but didn't find item 4 (line numbers or not). should I include some C++ macros there?

          T Offline
          T Offline
          Tom Archer
          wrote on last edited by
          #4

          What do you see as options on the Preprocessor page? The third item should be labelled "Generate Preprocessed File". You click in that and drop the combo down to see the options. Cheers, Tom Archer Author, Inside C# A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.

          L 1 Reply Last reply
          0
          • T Tom Archer

            What do you see as options on the Preprocessor page? The third item should be labelled "Generate Preprocessed File". You click in that and drop the combo down to see the options. Cheers, Tom Archer Author, Inside C# A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.

            L Offline
            L Offline
            lucy 0
            wrote on last edited by
            #5

            I did a Project->Settings->C/C++ -> Category: Preprocessor, and what I see is: Preprocessor definitions (edit box) UnDefined symbols: (check box, followed by an edit box) Additional include directories: (edit box) Ignore standard include paths (check box). What did I miss?

            T 1 Reply Last reply
            0
            • L lucy 0

              I did a Project->Settings->C/C++ -> Category: Preprocessor, and what I see is: Preprocessor definitions (edit box) UnDefined symbols: (check box, followed by an edit box) Additional include directories: (edit box) Ignore standard include paths (check box). What did I miss?

              T Offline
              T Offline
              Tom Archer
              wrote on last edited by
              #6

              Oh. Are you running VS6? I'm running VS.NET. If you're running VS6, what you need to know is the following:

              • Create preprocessor file - add /P to the CL call
              • Create preprocessor file (with line numbers) - add /EP and /P to the CL call

              Therefore, either look through for the pages for this option or manually add it. Cheers, Tom Archer Author, Inside C# A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.

              L 1 Reply Last reply
              0
              • T Tom Archer

                From the Property Pages dialog:

                1. Expand the Configuration folder
                2. Expand the C/C++ folder
                3. Click the Preprocessor item
                4. Change the Generate Preprossed File to the desired setting (line numbers or not in the output file)

                When you build the project, you will have preprocessed versions of your files with the .i extension. Cheers, Tom Archer Author, Inside C# A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.

                H Offline
                H Offline
                hiseldl
                wrote on last edited by
                #7

                the Property Pages, do you mean Project->Settings from the main menu? Also, I am using VStudio 6 Enterprise Edition, if that helps. .dave. David Hisel -- http://www.hisel.com/

                T 1 Reply Last reply
                0
                • H hiseldl

                  the Property Pages, do you mean Project->Settings from the main menu? Also, I am using VStudio 6 Enterprise Edition, if that helps. .dave. David Hisel -- http://www.hisel.com/

                  T Offline
                  T Offline
                  Tom Archer
                  wrote on last edited by
                  #8

                  Sorry. I use VS.NET and forget that most don't. Look at my response to Lucy where I explain (as well as I can withouut the VS6 environment installed) how to do this in VS6. Cheers, Tom Archer Author, Inside C# A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.

                  1 Reply Last reply
                  0
                  • T Tom Archer

                    Oh. Are you running VS6? I'm running VS.NET. If you're running VS6, what you need to know is the following:

                    • Create preprocessor file - add /P to the CL call
                    • Create preprocessor file (with line numbers) - add /EP and /P to the CL call

                    Therefore, either look through for the pages for this option or manually add it. Cheers, Tom Archer Author, Inside C# A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.

                    L Offline
                    L Offline
                    lucy 0
                    wrote on last edited by
                    #9

                    got it. Thank you, Tom. In VS6, it's add /P or /EP (output is the output window of VS6) in Project Options of Project->Settings->C/C++ ->Category: Preprocessor.

                    T 1 Reply Last reply
                    0
                    • L lucy 0

                      got it. Thank you, Tom. In VS6, it's add /P or /EP (output is the output window of VS6) in Project Options of Project->Settings->C/C++ ->Category: Preprocessor.

                      T Offline
                      T Offline
                      Tom Archer
                      wrote on last edited by
                      #10

                      No problem, Lucy. This is tremendously valuable in learning how those magic MFC and ATL macros work. Cheers, Tom Archer Author, Inside C# A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.

                      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