我看的是第四版,编译第一个程序就出现以下错误:
--------------------Configuration: 01 ErrorShow - Win32 Debug--------------------
Compiling resources...
Compiling...
ErrorShow.cpp
You are not using the latest Platform SDK header/library 
files. This may prevent the project from building correctly.
c:\program files\programming applications\cmnhdr.h(212) : error C2065: 'GetWindowLongPtr' : undeclared identifier
c:\program files\programming applications\cmnhdr.h(212) : error C2065: 'GWLP_HINSTANCE' : undeclared identifier
c:\program files\programming applications\01-errorshow\errorshow.cpp(83) : error C2065: 'PCTSTR' : undeclared identifier
c:\program files\programming applications\01-errorshow\errorshow.cpp(83) : error C2146: syntax error : missing ')' before identifier 'LocalLock'
c:\program files\programming applications\01-errorshow\errorshow.cpp(83) : error C2059: syntax error : ')'
c:\program files\programming applications\01-errorshow\errorshow.cpp(125) : error C2664: 'DialogBoxParamA' : cannot convert parameter 4 from 'long (struct HWND__ *,unsigned int,unsigned int,long)' to 'int (__stdcall *)(struct HWND__ *,unsigned int,u
nsigned int,long)'
        None of the functions with this name in scope match the target type
Error executing cl.exe.01 ErrorShow.exe - 6 error(s), 0 warning(s)
有过类似遭遇的前辈,现在是得分的好时机!

解决方案 »

  1.   

    好,我来骗点分。出现这个问题是因为你机器上的平台与《WINSOOWS核心编程》提供的源代码不一致。解决方法有二:一是下载最新的SDK,二比较简单,就是把cmnhdr.h中GetWindowLongPtr宏注释掉,然后把用到这个宏的代码注释掉,不影响程序的功能。
      

  2.   

    http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
    下载并安装Core SDK 就可以了
      

  3.   

    GetWindowLongPtr声明在.h中的是旧的,更新.h
      

  4.   

    My god!!!
    有237.1mb,我不是宽带,我该怎么办????
      

  5.   

    此贴一个星期之内结,我正要装宽带,等装了只后下载core sdk,没问题立即结贴.
      

  6.   

    如果GetWindowLongPtr不是十分重要就改成GetWindowLong()。因
    为程序不是针对窗体的。
      

  7.   

    顺便问一下:是不是在中文操作系统里面,只能得到中文的错误代码?
    比如errorshow.exe,在我在操作系统里面就全是 error number not found
      

  8.   

    我做过 可以用别的函数替代GetWindowLongPtr 还有一些东西要改一改
    比如要定义
    #define PCTSTR  LPCTSTR
    erroshow.exe源程序中有一句MAKELANGID你把后面的宏参数改了就可以在中文平台下用了