theEagles

I am sailing, to be with you, to be free.
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Add/remove operation is impossible, because the code element is readonly

Posted on 2012-08-28 11:30  theEagles  阅读(251)  评论(0)    收藏  举报

在VS2008中,有时候添加类的消息响应函数会弹出 “Add/remove operation is impossible, because the code element is readonly”

解决方案是:
    如果在这个出问题的类的头文件里定义了任何函数,把函数代码从头文件剪切到cpp文件里。关闭Visual Studio,删除ncb文件和suo文件。
     打开工程,待Intellisesnce update完毕后,添加消息响应代码。