SS_REALSIZECONTROL undefined 2104 和 heap curruption detected错误

来源:互联网 发布:it外包网站源码 编辑:程序博客网 时间:2024/04/29 06:17


今天遇到一个非常稀奇的问题,一个VS2008编好的MFC小程序,以前也能打开的,什么都是正常的。今天要在此基础上作点大的修改,然后就想复制一份。

    可是复制完之后,想打开复制好的工程,发现.rc文件打不开了,出现了以下的提示:

      error RC2104:undefined keyword or keyname:SS_REALSIZECONTROL

    以为是复制过程中出了问题,于是就删除复制品,再来复制一份,发现还是老问题。再看看原版吧,一看没有问题啊,能打开,很正常。我再把原版的工程文件夹移动到了一个新的地方,再打开,发现出现了以上的问题了,而且还还原不了。

    上网搜索了下,发现解决方法如下:

    以文本方式打开.rc文件,把SS_REALSIZECONTROL删除,保存,关闭,打开,好了。

    这个治标不治本的方法,貌似管用。

    再深入想搞明白怎么回事,发现如下:

This is a known bug confirmed by Microsoft. An .rc file with menubar resources cannot be currently loaded as resource file in eVC. This will be fixed in future versions of Smartphone SDK. Meanwhile Microsoft recommends to manually edit rc-file in text editor ( see Readme.htm file for Smartphone SDK). It's not a satisfying approach, however, since editing application resources manually is a much more difficult and time-consuming operation than editing them in eVC resurce editor.

  A better approach is to place manubar resource in a separate text file,which will be included in the main rc-file during resource compilation (but not when rc-file is opened in eVC resource editor).

既然是bug,那还搞个什么搞,郁闷。

以上转自http://blog.sina.com.cn/s/blog_4ac766c00100rxuf.html


heap curruption detected 错误,今天碰到这个错误,搜了下有篇文章说是动态内存分配有问题,具体地址忘记了。。。然后我看了下的的代码

    有个byte[] 的序列号要转成char* 类型,是byte[16], 然后我就malloc 16.。。。。

    char* p = (char*)malloc(16);
    虽然平时都知道字符串类型最后一个是'\0',临了用的时候给忘记了,这里只要比原来byte空间多一个就好了,用来存放'\0'。。。