问题:有幸在某网站上下到了<windows核心编程>(Jeffrey Richter)配套光盘中的源代码,
在用VC6.0编译的时候总会出来如下错误提示:
Compiling...
ErrorShow.cpp
You are not using the latest Platform SDK header/library 
files. This may prevent the project from building correctly.
e:\vc++_programming\01-errorshow\cmnhdr.h(212) : error C2065: 'GetWindowLongPtr' : undeclared identifier
e:\vc++_programming\01-errorshow\cmnhdr.h(212) : error C2065: 'GWLP_HINSTANCE' : undeclared identifier
e:\vc++_programming\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,unsigned int,long)'
None of the functions with this name in scope match the target type
Error executing cl.exe.ErrorShow.obj - 3 error(s), 0 warning(s)我觉得很奇怪,为什么说"You are not using the latest Platform SDK header/library "?
我可是用的vc6.0企业版呀,难道Platform SDK header/library还不够新吗?

解决方案 »

  1.   

    呵呵
    可能不是因为这原因!
     
    最新的platform sdk可以到ms下载
    记得要配置哦
    而且要放在 include 第一项!
      

  2.   

    I guess maybe you didn't configure the header files correctly,check it.
      

  3.   

    http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/ext/tutorials/explorer.asp
      

  4.   

    我想你还是别下了,340 多兆。我想 VC6 就足够使用那本书的源代码了。例如:头两个问题应该是你的头文件包含得有问题,第三个问题e:\vc++_programming\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,unsigned int,long)'这个问题只要查找一下那个文件 125 行传递给 DialogBoxParam 或 DialogBox 的对话框过程的原型就可以了。
      

  5.   

    GetWindowLongPtr在vc6.0中windows.h没有定义,Platform SDK header/library不够新,只要下载新的SDK header/libraray就可以,直接到ms的网站上就可以。最少必须换掉这个头文件和相应的库文件。
    因为在其它的sdk,比如说DirectX SDK,Netmeeting SDK也应该有新的windows.h,及相应的库文件。所以这个办法也行得通(我就是这么做的)