Failed to return new code element

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • RML

    Failed to return new code element

    Hi, I have a VS2005 VC++ application which no longer allows me to add a
    Variable or Function to a class in the project. I attempt to add a new
    (public) Variable called Temp123, and get this error...

    Failed to return new Code Element. Possibley syntax error. New Element
    Name. Temp123

    I recently changed the name of the cpp file (using Solution Explorer) of
    this class. Since that change, the error always occurs. I attempted to
    change the cpp name back to its original name, but still get the error.

    Can anyone help me out.

    RML

  • Marcus Heege

    #2
    Re: Failed to return new code element

    Hi RML

    "RML" <RML@discussion s.microsoft.com > wrote in message
    news:0F0CAA04-ED25-481C-82E1-A66DE5B7781F@mi crosoft.com...[color=blue]
    > Hi, I have a VS2005 VC++ application which no longer allows me to add a
    > Variable or Function to a class in the project. I attempt to add a new
    > (public) Variable called Temp123, and get this error...
    >
    > Failed to return new Code Element. Possibley syntax error. New Element
    > Name. Temp123
    >
    > I recently changed the name of the cpp file (using Solution Explorer) of
    > this class. Since that change, the error always occurs. I attempted to
    > change the cpp name back to its original name, but still get the error.
    >
    > Can anyone help me out.
    >
    > RML[/color]

    Does this problem still exist if you add a new cpp file with the name you
    want and copy the whole contents of the old file to the new one and remove
    the old one from the solution?

    Marcus


    Comment

    • RML

      #3
      Re: Failed to return new code element

      Hi Marcus, I tried your suggestion, but still have the same problem.

      RML

      "Marcus Heege" wrote:
      [color=blue]
      > Hi RML
      >
      > "RML" <RML@discussion s.microsoft.com > wrote in message
      > news:0F0CAA04-ED25-481C-82E1-A66DE5B7781F@mi crosoft.com...[color=green]
      > > Hi, I have a VS2005 VC++ application which no longer allows me to add a
      > > Variable or Function to a class in the project. I attempt to add a new
      > > (public) Variable called Temp123, and get this error...
      > >
      > > Failed to return new Code Element. Possibley syntax error. New Element
      > > Name. Temp123
      > >
      > > I recently changed the name of the cpp file (using Solution Explorer) of
      > > this class. Since that change, the error always occurs. I attempted to
      > > change the cpp name back to its original name, but still get the error.
      > >
      > > Can anyone help me out.
      > >
      > > RML[/color]
      >
      > Does this problem still exist if you add a new cpp file with the name you
      > want and copy the whole contents of the old file to the new one and remove
      > the old one from the solution?
      >
      > Marcus
      >
      >
      >[/color]

      Comment

      • Marcus Heege

        #4
        Re: Failed to return new code element

        Hi RML
        "RML" <RML@discussion s.microsoft.com > wrote in message
        news:DA4B9893-8CED-46A4-8BBF-A7249129A827@mi crosoft.com...[color=blue]
        > Hi Marcus, I tried your suggestion, but still have the same problem.
        >
        > RML
        >
        > "Marcus Heege" wrote:
        >[color=green]
        >> Hi RML
        >>
        >> "RML" <RML@discussion s.microsoft.com > wrote in message
        >> news:0F0CAA04-ED25-481C-82E1-A66DE5B7781F@mi crosoft.com...[color=darkred]
        >> > Hi, I have a VS2005 VC++ application which no longer allows me to add a
        >> > Variable or Function to a class in the project. I attempt to add a new
        >> > (public) Variable called Temp123, and get this error...
        >> >
        >> > Failed to return new Code Element. Possibley syntax error. New
        >> > Element
        >> > Name. Temp123
        >> >
        >> > I recently changed the name of the cpp file (using Solution Explorer)
        >> > of
        >> > this class. Since that change, the error always occurs. I attempted
        >> > to
        >> > change the cpp name back to its original name, but still get the error.
        >> >
        >> > Can anyone help me out.
        >> >
        >> > RML[/color]
        >>
        >> Does this problem still exist if you add a new cpp file with the name you
        >> want and copy the whole contents of the old file to the new one and
        >> remove
        >> the old one from the solution?
        >>
        >> Marcus[/color][/color]

        Next attempt: Close the poject, delete the .ncb file and reopen the project.


        Comment

        • RML

          #5
          Re: Failed to return new code element

          Tried that, and it did not work.

          RML

          "Marcus Heege" wrote:
          [color=blue]
          > Hi RML
          > "RML" <RML@discussion s.microsoft.com > wrote in message
          > news:DA4B9893-8CED-46A4-8BBF-A7249129A827@mi crosoft.com...[color=green]
          > > Hi Marcus, I tried your suggestion, but still have the same problem.
          > >
          > > RML
          > >
          > > "Marcus Heege" wrote:
          > >[color=darkred]
          > >> Hi RML
          > >>
          > >> "RML" <RML@discussion s.microsoft.com > wrote in message
          > >> news:0F0CAA04-ED25-481C-82E1-A66DE5B7781F@mi crosoft.com...
          > >> > Hi, I have a VS2005 VC++ application which no longer allows me to add a
          > >> > Variable or Function to a class in the project. I attempt to add a new
          > >> > (public) Variable called Temp123, and get this error...
          > >> >
          > >> > Failed to return new Code Element. Possibley syntax error. New
          > >> > Element
          > >> > Name. Temp123
          > >> >
          > >> > I recently changed the name of the cpp file (using Solution Explorer)
          > >> > of
          > >> > this class. Since that change, the error always occurs. I attempted
          > >> > to
          > >> > change the cpp name back to its original name, but still get the error.
          > >> >
          > >> > Can anyone help me out.
          > >> >
          > >> > RML
          > >>
          > >> Does this problem still exist if you add a new cpp file with the name you
          > >> want and copy the whole contents of the old file to the new one and
          > >> remove
          > >> the old one from the solution?
          > >>
          > >> Marcus[/color][/color]
          >
          > Next attempt: Close the poject, delete the .ncb file and reopen the project.
          >
          >
          >[/color]

          Comment

          • Marcus Heege

            #6
            Re: Failed to return new code element

            "RML" <RML@discussion s.microsoft.com > wrote in message
            news:83B01A1D-F5F3-427A-80C5-69CC9AEB1344@mi crosoft.com...[color=blue]
            > Tried that, and it did not work.
            >
            > RML
            >[/color]

            In this case, it seems to be somehow realted to your file itself. To find
            the source, I would comment out the whole body of the class and see if it is
            possilbe to add a new function to the empty class. If yes, uncomment more
            and more parts until the problem reappears.
            If you have found the reason, please share it here.

            I don't see anything better to do here, sorry

            Marcus


            Comment

            • RML

              #7
              Re: Failed to return new code element

              Here is what I did to get it to work.

              I created a new class. I cut & pasted the code from the original classes .h
              & .cpp files into the respective .h & .cpp files of the new class. In the
              new class files, I then replace the old class name with the new, then I
              deleted the original class files.

              It was a round about way, but it worked.

              RML

              "Marcus Heege" wrote:
              [color=blue]
              > "RML" <RML@discussion s.microsoft.com > wrote in message
              > news:83B01A1D-F5F3-427A-80C5-69CC9AEB1344@mi crosoft.com...[color=green]
              > > Tried that, and it did not work.
              > >
              > > RML
              > >[/color]
              >
              > In this case, it seems to be somehow realted to your file itself. To find
              > the source, I would comment out the whole body of the class and see if it is
              > possilbe to add a new function to the empty class. If yes, uncomment more
              > and more parts until the problem reappears.
              > If you have found the reason, please share it here.
              >
              > I don't see anything better to do here, sorry
              >
              > Marcus
              >
              >
              >[/color]

              Comment

              Working...