CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2008
    Location
    India
    Posts
    780

    Add/Remove Operation is not possible because the code element is read only

    Hi all,

    Actually i am new to VC2005. My problem is whenever i am trying to add any function say OnCtlColor to my class a message is displayed that Add/remove operation is not possible because the code element is read-only.

    I am not getting how to correct it...

    Can anybody help me in correcting it...

    Thanks in advance

  2. #2
    Join Date
    Dec 2007
    Posts
    17

    Re: Add/Remove Operation is not possible because the code element is read only

    You deleted some things. No problem, try on another new one from the start. There is always NEXT, NEXT NEXT PROJECT to move on.

  3. #3
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: Add/Remove Operation is not possible because the code element is read only

    Quote Originally Posted by vjshankwar
    Add/remove operation is not possible because the code element is read-only.
    .
    .
    Can anybody help me in correcting it...
    Not realy. Consider posting your project, since this is the only way to test it and find a solution.
    Last edited by JohnCz; March 5th, 2008 at 06:19 AM.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  4. #4
    Join Date
    May 2006
    Location
    Norway
    Posts
    1,709

    Re: Add/Remove Operation is not possible because the code element is read only

    This has nothing to do with your code at all.

    Do you use any version control tools? That can be the cause.

    It could be a VS problem. I would suggest that you make sure that the folder containing your project is not read-only. Right click on the folder and select properties. Then try again.

    If that does not help, it might help to clean the solution and do a new build.

    I had similiar problem once and the above steps was successful.

  5. #5
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: Add/Remove Operation is not possible because the code element is read only

    Quote Originally Posted by laitinen
    This has nothing to do with your code at all.
    yOU ARE CORECT; thank you for spotting.
    I meant "project" and i will change it.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  6. #6
    Join Date
    Aug 2004
    Posts
    5

    Re: Add/Remove Operation is not possible because the code element is read only

    Deleting of many auxiliary solution and project files include *.ncb of "Visual Assist" solves this my problem.

  7. #7
    Join Date
    Feb 2009
    Location
    Vietnam
    Posts
    15

    Re: Add/Remove Operation is not possible because the code element is read only

    I met this problem. (VS2008). My solution was to create a new project or add message handlers by myself (not using wizard). I don't know the reason

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured