我在Windows2000下使用VC++ 6.0编译《Windows核心编程》附送CD中的例子,出现下面的错误,请教如何解决??特别是“You are not using the latest Platform SDK header/library files. This may prevent the project from building correctly.”让我很迷茫!
在线等待!!--------------------Configuration: 01 ErrorShow - Win32 Debug--------------------
Compiling...
ErrorShow.cpp
You are not using the latest Platform SDK header/library
files. This may prevent the project from building correctly.
d:\mxl\study\vc\cmnhdr.h(212) : error C2065: 'GetWindowLongPtr' : undeclared identifier
d:\mxl\study\vc\cmnhdr.h(212) : error C2065: 'GWLP_HINSTANCE' : undeclared identifier
d:\mxl\study\vc\01-errorshow\errorshow.cpp(83) : error C2065: 'PCTSTR' : undeclared identifier
d:\mxl\study\vc\01-errorshow\errorshow.cpp(83) : error C2146: syntax error : missing ')' before identifier 'LocalLock'
d:\mxl\study\vc\01-errorshow\errorshow.cpp(83) : error C2059: syntax error : ')'
d:\mxl\study\vc\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.01 ErrorShow.exe - 6 error(s), 0 warning(s)
在线等待!!--------------------Configuration: 01 ErrorShow - Win32 Debug--------------------
Compiling...
ErrorShow.cpp
You are not using the latest Platform SDK header/library
files. This may prevent the project from building correctly.
d:\mxl\study\vc\cmnhdr.h(212) : error C2065: 'GetWindowLongPtr' : undeclared identifier
d:\mxl\study\vc\cmnhdr.h(212) : error C2065: 'GWLP_HINSTANCE' : undeclared identifier
d:\mxl\study\vc\01-errorshow\errorshow.cpp(83) : error C2065: 'PCTSTR' : undeclared identifier
d:\mxl\study\vc\01-errorshow\errorshow.cpp(83) : error C2146: syntax error : missing ')' before identifier 'LocalLock'
d:\mxl\study\vc\01-errorshow\errorshow.cpp(83) : error C2059: syntax error : ')'
d:\mxl\study\vc\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.01 ErrorShow.exe - 6 error(s), 0 warning(s)
1。去掉ptr
2。去掉p
3.改为LPCTSTR
在第四个参数前加上(DLGPROC)
我不知道VC++怎么发现“You are not using the latest Platform SDK header/library files. This may prevent the project from building correctly.”
另外,怎样更新我的sdk?
GetWindowLong本身功能没有太大的区别,不过是为了兼容以后的64位程序用的而已,所以一般的情况下改改函数和参数就可以了