请问有谁编译过《windows核心编程》中的代码没有啊,我编译的时候老是报错,cmnhdr.h(212) : error C2065: 'GetWindowLongPtr' : undeclared identifier
cmnhdr.h(212) : error C2065: 'GWLP_HINSTANCE' : undeclared identifier
errorshow.cpp(84) : error C2065: 'PCTSTR' : undeclared identifier
errorshow.cpp(84) : error C2146: syntax error : missing ')' before identifier 'LocalLock'
errorshow.cpp(84) : error C2059: syntax error : ')'
errorshow.cpp(126) : 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)'我在文件cmnhdr.h 中 #include <windows.h>也不行

解决方案 »

  1.   

    #include <windows.h>
    的位置不对也会出问题,你试试调一下它的顺序。
      

  2.   

    @
    CmnHdr.h
    212:改成LoadIcon((HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE),errorshow.cpp
    83:改成PTSTR
    125:改成
    NULL, (DLGPROC)Dlg_Proc, _ttoi(pszCmdLine));解决的办法是: 方法1:安装VC6SP4 + PlatForm SDK
    http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en方法2: 使用VC.Net方法3:像GetWindowLongPtr这样的函数,不妨直接修改成GetWindowlong,并修改相应的参数部分。需要对msdn比较熟悉。
    @