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. Convert C++ from VisC++ 6 to VS 2008 [modified]

Convert C++ from VisC++ 6 to VS 2008 [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpvisual-studioquestionlounge
9 Posts 4 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.
  • G Offline
    G Offline
    gartnerj
    wrote on last edited by
    #1

    Folks, I have a VERY OLD legacy app that I'm trying to compile under VS 2008 (I am NOT an MFC developer at all). I am running into build errors on things like: template <> void AFXAPI ConstructElements <SubjectUsage> (SubjectUsage * pSubName, int nCount) NOTE: Edited this to correct the line ERRORS for this is: C2143 Syntax error: missing ";" before "<" C2182: "ConstructElements: illegal use of type 'void' C2988: unrecognizable template declaration/definition I know NOTHING about the AFXAPI, but the file does have an <code>#include <afxtempl.h> </code> Any help greatly appreciated, and in general, any words of wisdom from moving from VC++6 to VS2008?

    modified on Wednesday, May 20, 2009 2:06 PM

    D L S 3 Replies Last reply
    0
    • G gartnerj

      Folks, I have a VERY OLD legacy app that I'm trying to compile under VS 2008 (I am NOT an MFC developer at all). I am running into build errors on things like: template <> void AFXAPI ConstructElements <SubjectUsage> (SubjectUsage * pSubName, int nCount) NOTE: Edited this to correct the line ERRORS for this is: C2143 Syntax error: missing ";" before "<" C2182: "ConstructElements: illegal use of type 'void' C2988: unrecognizable template declaration/definition I know NOTHING about the AFXAPI, but the file does have an <code>#include <afxtempl.h> </code> Any help greatly appreciated, and in general, any words of wisdom from moving from VC++6 to VS2008?

      modified on Wednesday, May 20, 2009 2:06 PM

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      gartnerj wrote:

      template <> void AFXAPI ConstructElements (SubjectUsage * pSubName, int nCount)

      There appears to be something missing from this statement. Try clicking the "Do not interpret HTML..." checkbox, and use the Verify button.

      gartnerj wrote:

      C2143 Syntax error: missing ";" before "<"

      It looks as though the compiler does not know what SubjectUsage is.

      "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      G 1 Reply Last reply
      0
      • G gartnerj

        Folks, I have a VERY OLD legacy app that I'm trying to compile under VS 2008 (I am NOT an MFC developer at all). I am running into build errors on things like: template <> void AFXAPI ConstructElements <SubjectUsage> (SubjectUsage * pSubName, int nCount) NOTE: Edited this to correct the line ERRORS for this is: C2143 Syntax error: missing ";" before "<" C2182: "ConstructElements: illegal use of type 'void' C2988: unrecognizable template declaration/definition I know NOTHING about the AFXAPI, but the file does have an <code>#include <afxtempl.h> </code> Any help greatly appreciated, and in general, any words of wisdom from moving from VC++6 to VS2008?

        modified on Wednesday, May 20, 2009 2:06 PM

        L Offline
        L Offline
        led mike
        wrote on last edited by
        #3

        gartnerj wrote:

        Any help greatly appreciated, and in general, any words of wisdom from moving from VC++6 to VS2008?

        How to: Upgrade Projects from Previous Versions of Visual C++[^]

        G 1 Reply Last reply
        0
        • L led mike

          gartnerj wrote:

          Any help greatly appreciated, and in general, any words of wisdom from moving from VC++6 to VS2008?

          How to: Upgrade Projects from Previous Versions of Visual C++[^]

          G Offline
          G Offline
          gartnerj
          wrote on last edited by
          #4

          Thanks -- I did read those pages, but not a lot of info on using old MFC with VS 2008.

          L 1 Reply Last reply
          0
          • D David Crow

            gartnerj wrote:

            template <> void AFXAPI ConstructElements (SubjectUsage * pSubName, int nCount)

            There appears to be something missing from this statement. Try clicking the "Do not interpret HTML..." checkbox, and use the Verify button.

            gartnerj wrote:

            C2143 Syntax error: missing ";" before "<"

            It looks as though the compiler does not know what SubjectUsage is.

            "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            G Offline
            G Offline
            gartnerj
            wrote on last edited by
            #5

            Well, I didn't include all of the code, but the SubjectUsage class is defined right above this line in the file, so that shouldn't be an issue. This code DOES compile in Visual C++ 6.0.   I'm sure there must be differences with C++ and with the MFC supplied with VS 2008 that is causing this -- not sure if there are any project switches to set for compatibility? Also, the CORRECT statement that has the errors is: template <> void AFXAPI ConstructElement <SubjectUsage> (SubjectUsage * pSubUsage, int nCount) Sorry about that!

            1 Reply Last reply
            0
            • G gartnerj

              Folks, I have a VERY OLD legacy app that I'm trying to compile under VS 2008 (I am NOT an MFC developer at all). I am running into build errors on things like: template <> void AFXAPI ConstructElements <SubjectUsage> (SubjectUsage * pSubName, int nCount) NOTE: Edited this to correct the line ERRORS for this is: C2143 Syntax error: missing ";" before "<" C2182: "ConstructElements: illegal use of type 'void' C2988: unrecognizable template declaration/definition I know NOTHING about the AFXAPI, but the file does have an <code>#include <afxtempl.h> </code> Any help greatly appreciated, and in general, any words of wisdom from moving from VC++6 to VS2008?

              modified on Wednesday, May 20, 2009 2:06 PM

              S Offline
              S Offline
              Stuart Dootson
              wrote on last edited by
              #6

              This page[^] tells you what to do - basically, don't use ConstructElements any more!

              Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

              G 1 Reply Last reply
              0
              • G gartnerj

                Thanks -- I did read those pages, but not a lot of info on using old MFC with VS 2008.

                L Offline
                L Offline
                led mike
                wrote on last edited by
                #7

                gartnerj wrote:

                but not a lot of info on using old MFC with VS 2008.

                Yes but old MFC is just C++. Stuart has provided the pinpoint documentation for you so you can move on. If you find other problems they will be similar because VC6 did not fully implement the C++ Standards. I don't believe 2008 does either but it implements much more which can produce compiler errors in old code due to the compiler enforcing more standards. Each version of VC since 6 has been more compliant so as in this example the documentation might be version specific since it was changed in a specific version.

                G 1 Reply Last reply
                0
                • S Stuart Dootson

                  This page[^] tells you what to do - basically, don't use ConstructElements any more!

                  Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

                  G Offline
                  G Offline
                  gartnerj
                  wrote on last edited by
                  #8

                  Thanks -- VERY helpful!!!

                  1 Reply Last reply
                  0
                  • L led mike

                    gartnerj wrote:

                    but not a lot of info on using old MFC with VS 2008.

                    Yes but old MFC is just C++. Stuart has provided the pinpoint documentation for you so you can move on. If you find other problems they will be similar because VC6 did not fully implement the C++ Standards. I don't believe 2008 does either but it implements much more which can produce compiler errors in old code due to the compiler enforcing more standards. Each version of VC since 6 has been more compliant so as in this example the documentation might be version specific since it was changed in a specific version.

                    G Offline
                    G Offline
                    gartnerj
                    wrote on last edited by
                    #9

                    Thanks -- yeah that link really helped! I guess I was hoping that there would be some sort of compatibility mode setting for the compiler/project to allow this to work with minimal change, but I don't think that's possible!

                    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