Add/Remove operation is impossible, the code element ‘Cxxx’ is read only

 

When attempting to add a Control Event Handler to a control on a dialog, we are encountering the message: Add/Remove operation is impossible, the code element ‘Cxxx’ is read only.

After an hour of trying to solve it my self, a quick Google search turned up the following solutions.

  • Add random charters to the .h/.cpp file
  • clean your solution
  • Close all open windows and close the project.
  • Delete .ncb and .suo files
  • Open your project solution and rebuild
  • Attempt to add your new control event handler.

This seemed to work for me with

Microsoft Visual studios 2009
Version 9.0.21022.8 RTM

Source: http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=99076

No Comments.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>