本书的第一章简单介绍了WinCE应用程序的开发,跟Win32应用程序的开发类似,也是要设计窗口类,注册窗口类,消息循环等。要想更好的理解掌握书中的内容,最好的方法是把书中的例子亲自手敲调试一边。很多貌似简单的内容,真正动手起来还是会遇到或多或少的问题。
书中的Hello3程序,在VS2008上直接编译,是通不过的。 它会提示类似的信息:
1
>
Hello.obj : error LNK2019: unresolved external symbol __security_cookie referenced
in
function
"
long __cdecl MainWndProc(struct HWND__ *,unsigned int,unsigned int,long)
"
(
?
MainWndProc@@YAJPAUHWND__@@IIJ@Z)
1 > Hello.obj : error LNK2019: unresolved external symbol __security_check_cookie referenced in function " long __cdecl MainWndProc(struct HWND__ *,unsigned int,unsigned int,long) " ( ? MainWndProc@@YAJPAUHWND__@@IIJ@Z)
1 > LIBCMTD.lib(gshandler.obj) : error LNK2001: unresolved external symbol __security_check_cookie
1 > Pocket PC 2003 (ARMV4)\Debug / WinCETest.exe : fatal error LNK1120: 2 unresolved externals
1 > Hello.obj : error LNK2019: unresolved external symbol __security_check_cookie referenced in function " long __cdecl MainWndProc(struct HWND__ *,unsigned int,unsigned int,long) " ( ? MainWndProc@@YAJPAUHWND__@@IIJ@Z)
1 > LIBCMTD.lib(gshandler.obj) : error LNK2001: unresolved external symbol __security_check_cookie
1 > Pocket PC 2003 (ARMV4)\Debug / WinCETest.exe : fatal error LNK1120: 2 unresolved externals
解决方法有两种:
1. 新建一个非空的Win32 smart device windows project, 然后复制 stdafx.h 和stdafx.cpp 到本项目中来
2. 在你的Hello3.cpp中引用altcecrt.h 头文件: #include <altcecrt.h>