MESSAGE: Resource Editor: Add/Remove operation is impossible, because the code element '(null)' is read only
So, I moved files from /ProjectA/ProjectA to just be /ProjectA fixed the project settings deleted and added files to go with the changes. My 'ClassView' contains duplicate classes CMyClass and CMyClass with two different paths one in /ProjectA/ProjectA and the new one /ProjectA; I can't delete the old /ProjectA/ProjectA one and now I get this message 'Resource Editor: Add/Remove operation is impossible, because the code element '(null)' is read only' when I try and add a button to CMyClass. I just double click the button, message. So, I go through and find the 'Events' panel and find the ID and then try and add an OnClick - message.....
I read a post that was titled something similar to this, a response said to play around with the .rc file; which I did; and nothing....
I am running MVS 2005 Version 8.0.50215.44 (beta2.050215-4400) C++ 2005 55603-000-0000016-00995
Any Help

Resource Editor: Add/Remove operation is impossible '(null)' is read only
SalvaPatuel
kalkumar
JayPi
Update, Finally I got it to work...
Whenever you want to insert a new message from a child window that will create a WM_NOTIFY message in the main window, you have to close all open files, clean the solution, build it, and then voila, you will be able to insert a single message. If you want more messages, you need to repeat the process over again...
Lasse
Donald Burr
I have this as well.
I want to create a WM_Notify handler for a PPC dialog based aplication.
Same old "Add/Remove operation is impossible '(CCCRDecoMancerdlg)' is read only"
How can I get around that
Cheers,
Lasse
KBar II
Intelligence
Hi,
I have hit this problem a couple of times as well, however, I am using the RTM. Most recently, I had just created a new Smart Device app and added a new class derived from CButton. Any attempts to add an Override or Message Handler resulted in the same Add/Remove error.
Microsoft Visual Studio 2005
Version 8.0.50727.42 (RTM.050727-4200)
Microsoft .NET Framework
Version 2.0.50727
Installed Edition: Enterprise
Hans1982
I encounter this problem frequently.
To get around it, I open the class definition .h file and manually enter the message header. Then from properties I add the message handler. For some reason this works.
Stanislav Ogryzkov
Well I got this pb too ...
Is this really a VC8 bug !
The differents "tricks" you propose do not work for me ... another ideas
REspawn
Hi,
I found another way to get rid of this bug of VS2005 : I found out that I get this error only when the class (like CMyDialog) is declared in the associated .h file ( like mydialog.h), not in the .cpp file
If I move the declaration of the calls from the .h to the .cpp file, I can add new message handlers!
So, my solution is :
-cut the class declaration block from the .h file and paste it in the .cpp file
- wait a few moment for Intellisesnce update... ( or better, close VS8, delete .ncb file, reopen VS8)
-add the message handlers, methods,...
- cut and paste again the declaration block from the .cpp to the .h file
I thing this is a very serious VC8 bug...
Patrick
MonuReddy
I eventually got passed it, but the list of things I tried was pretty long. However, I think the last thing I did was just 'Build' the solution and then it let me add handlers, etc. Try that and let me know if it worked.
Thanks,
Nick
ClintZync
Hi Nick,
Nope that does not work...
Infact, now the dialog messages properties page says that it has a function for WM_ParentNotify, but no code is visible in the *.cpp file or header file.. And I still cannot create new message handlers.. I guess I will have to create a new project all together and start over... :( I am not impressed.. Pretty basic functionality not working here...
Cheers,
Lasse
T.Vargek
My *guess* is that this is related to an IntelliSense bug in Beta2 where renaming or removing files in Beta2 caused stale classes to still remain in the IntelliSense database. The resource editor is trying to use this stale data and is consequently failing. We fixed this post Beta2.
To confirm that this is the problem, can you close your solution, delete the solution .ncb file, and then reopen the solution again then try the same steps.
If it works, then my guess is correct and we did fix it. If it does not work, please let us know so we can investigate further (but we will need more information with exact steps).
Thanks.
Banhnam
I think it's fixed in VC 2005 SP1
http://blogs.msdn.com/vcblog/articles/643308.aspx
Resource Editor Add/Remove impossible code read only (Colin Carter)
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx FeedbackID=99076
others (unknown if fixed by above):
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx FeedbackID=105469
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx FeedbackID=98874
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx FeedbackID=98810
Feng26
I am hitting this bug very frequently too - VS 2005 Team Suite 8.0.50727.42 *sigh*