不要急,看书的时侯慢慢看!看仔细,一般书上的例子很少有错误,你看看是不是CMyPenApp类的头文件忘了包涵?
估计你没学过API,建议你先学一下C++。熟悉一下对像与瘟斗思的消息循环。

解决方案 »

  1.   

    这是编译器c1.exe的错误,需要重装VC,顺便说一下,我的朋友装过一个版本的中文汉化VC,就出现这个问题,换成英文版就解决了
      

  2.   

    Failure of the code generator to find a way to generate correct code for a construct. This is most often caused by the interaction of an expression and an optimization option. The optimization has generated a tree which the compiler does not know how to handle. Such a problem can often be fixed by removing one or more optimization options when compiling the particular function containing the line indicated in the error message这种情况极少出现,一般来讲是新旧版本的问题.你可以试着在工程设置中把优化选项禁止掉,具体操作是选择profect settings中的c/c++属性页,在optimizations选项中选取Disable(Debug)即可