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
-
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
the header and cpp file might me readonly. Remove the read only attribute of that files.
nave [OpenedFileFinder]
-
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
Steps: 1. Switch to [Class View] tab, and highlight the class name you are going to add
OnCtlColor
. (It must be a CWnd based class) 2. Right-click at that name, and choose [Peoperties]. 3. You are lead to [Properties] tab. You will see an icon-only button which has the name [Messages]. Click that [Messages] button. 4. The view will list all the available messages including WM_CTLCOLOR. Then you know what to do. :-DMaxwell Chen
-
the header and cpp file might me readonly. Remove the read only attribute of that files.
nave [OpenedFileFinder]
And sometimes it also happens when the .ncb file gets into crazy. Close the solution and re-open it should help.
Maxwell Chen
-
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
I have experienced this bug in Visual Studio 2005 in several of my projects. Its very annoying and I hope it was fixed in 2008. I found a strange way to fix the bug but it works almost everytime for me. 1.) Open the header file and copy the entire contents of the header into the corresponding CPP file at the very top. 2.) Close Visual Studio 2005. 3.) Delete the Intellisense database with the extension .NCB 4.) Re-open Visual Studio 2005 and wait a few seconds for the Intellisense database to rebuild. 5.) Try to add your OnCtlColor message handler again. 6.) Copy and paste your header contents back into the .H file. Let me know if it works for you! -Randor (David Delaune)
-
I have experienced this bug in Visual Studio 2005 in several of my projects. Its very annoying and I hope it was fixed in 2008. I found a strange way to fix the bug but it works almost everytime for me. 1.) Open the header file and copy the entire contents of the header into the corresponding CPP file at the very top. 2.) Close Visual Studio 2005. 3.) Delete the Intellisense database with the extension .NCB 4.) Re-open Visual Studio 2005 and wait a few seconds for the Intellisense database to rebuild. 5.) Try to add your OnCtlColor message handler again. 6.) Copy and paste your header contents back into the .H file. Let me know if it works for you! -Randor (David Delaune)
That sequence fixes so many bugs that they should have put a big button on the UI that does the sequence automatically LOL Cheers, Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
I have experienced this bug in Visual Studio 2005 in several of my projects. Its very annoying and I hope it was fixed in 2008. I found a strange way to fix the bug but it works almost everytime for me. 1.) Open the header file and copy the entire contents of the header into the corresponding CPP file at the very top. 2.) Close Visual Studio 2005. 3.) Delete the Intellisense database with the extension .NCB 4.) Re-open Visual Studio 2005 and wait a few seconds for the Intellisense database to rebuild. 5.) Try to add your OnCtlColor message handler again. 6.) Copy and paste your header contents back into the .H file. Let me know if it works for you! -Randor (David Delaune)
Randor wrote:
I have experienced this bug in Visual Studio 2005 in several of my projects. Its very annoying and I hope it was fixed in 2008.
I fear not... just had a similar problem myself in VS 2008, and deleting the .ncb fixed the issue here too. Cheers,
Billy. MCPD Windows Developer "Duct tape is like the force, it has a light side, a dark side and it holds the universe together!" - Anonymous my holding page..more coming soon!
-
Randor wrote:
I have experienced this bug in Visual Studio 2005 in several of my projects. Its very annoying and I hope it was fixed in 2008.
I fear not... just had a similar problem myself in VS 2008, and deleting the .ncb fixed the issue here too. Cheers,
Billy. MCPD Windows Developer "Duct tape is like the force, it has a light side, a dark side and it holds the universe together!" - Anonymous my holding page..more coming soon!
Wow, looks like I posted that back in March 2008. I am also using VS2008 now and it seems that it happens less often but the problem has not gone away. It seems that it mostly happens in my very large C++ projects. I guess we can only hope that VS2010 will have permanently squashed this little annoyance. I am glad that the post helped you fix your issue. Best Wishes, -David Delaune