首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > VSTS >

从VC6迁徙到VS2005 - ATL

2013-10-10 
从VC6迁移到VS2005 - ATL1.vc8以上版本推荐使用结尾为”_s”的改进函数(s-safe)比如原函数 - 安全函数fopen

从VC6迁移到VS2005 - ATL

1.      vc8以上版本推荐使用结尾为”_s”的改进函数(s-safe)

比如原函数 -> 安全函数

       fopen() ->fopen_s(),

       localtime()-> localtime_s()

       _itoa() ->_itoa_s()

      strcpy() ->strcpy_s()

      strncat() ->strncat_s()

编译器信息(C4996警告):

>d:\mydoc13\visual studio 2010\projects\v122\ucrc32.cpp(62) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>        e:\program files\microsoft visual studio 8\vc\include\stdio.h(234) : see declaration of 'fopen'1>d:\mydoc13\visual studio 2010\projects\v122\ucrc32.cpp(213) : warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>        e:\program files\microsoft visual studio 8\vc\include\time.inl(114) : see declaration of 'localtime'1>d:\mydoc13\visual studio 2010\projects\v122\ucrc32.cpp(222) : warning C4996: '_itoa': This function or variable may be unsafe. Consider using _itoa_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>        e:\program files\microsoft visual studio 8\vc\include\stdlib.h(501) : see declaration of '_itoa'1>d:\mydoc13\visual studio 2010\projects\v122\ucrc32.cpp(224) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>        e:\program files\microsoft visual studio 8\vc\include\string.h(74) : see declaration of 'strcpy'1>d:\mydoc13\visual studio 2010\projects\v122\ucrc32.cpp(225) : warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>        e:\program files\microsoft visual studio 8\vc\include\string.h(144) : see declaration of 'strncat'1>d:\mydoc13\visual studio 2010\projects\v122\ucrc32.cpp(232) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>        e:\program files\microsoft visual studio 8\vc\include\string.h(74) : see declaration of 'strcpy'1>d:\mydoc13\visual studio 2010\projects\v122\ucrc32.cpp(233) : warning C4996: '_itoa': This function or variable may be unsafe. Consider using _itoa_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>        e:\program files\microsoft visual studio 8\vc\include\stdlib.h(501) : see declaration of '_itoa'1>d:\mydoc13\visual studio 2010\projects\v122\ucrc32.cpp(236) : warning C4996: '_itoa': This function or variable may be unsafe. Consider using _itoa_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>        e:\program files\microsoft visual studio 8\vc\include\stdlib.h(501) : see declaration of '_itoa'1>d:\mydoc13\visual studio 2010\projects\v122\ucrc32.cpp(238) : warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>        e:\program files\microsoft visual studio 8\vc\include\string.h(144) : see declaration of 'strncat'1>d:\mydoc13\visual studio 2010\projects\v122\ucrc32.cpp(239) : warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>        e:\program files\microsoft visual studio 8\vc\include\string.h(144) : see declaration of 'strncat'1>d:\mydoc13\visual studio 2010\projects\v122\ucrc32.cpp(245) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>        e:\program files\microsoft visual studio 8\vc\include\string.h(74) : see declaration of 'strcpy'1>d:\mydoc13\visual studio 2010\projects\v122\ucrc32.cpp(246) : warning C4996: '_itoa': This function or variable may be unsafe. Consider using _itoa_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>        e:\program files\microsoft visual studio 8\vc\include\stdlib.h(501) : see declaration of '_itoa'1>d:\mydoc13\visual studio 2010\projects\v122\ucrc32.cpp(249) : warning C4996: '_itoa': This function or variable may be unsafe. Consider using _itoa_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>        e:\program files\microsoft visual studio 8\vc\include\stdlib.h(501) : see declaration of '_itoa'1>d:\mydoc13\visual studio 2010\projects\v122\ucrc32.cpp(252) : warning C4996: 'strncat': This function or variable may be unsafe. Consider using strncat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>        e:\program files\microsoft visual studio 8\vc\include\string.h(144) : see declaration of 'strncat'1>d:\mydoc13\visual studio 2010\projects\v122\ucrc32.cpp(290) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>        e:\program files\microsoft visual studio 8\vc\include\stdio.h(234) : see declaration of 'fopen'1>d:\mydoc13\visual studio 2010\projects\v122\ucrc32.cpp(308) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>        e:\program files\microsoft visual studio 8\vc\include\stdio.h(234) : see declaration of 'fopen'1>d:\mydoc13\visual studio 2010\projects\v122\ucrc32.cpp(309) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>        e:\program files\microsoft visual studio 8\vc\include\stdio.h(234) : see declaration of 'fopen'1>d:\mydoc13\visual studio 2010\projects\v122\ucrc32.cpp(333) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1>        e:\program files\microsoft visual studio 8\vc\include\string.h(74) : see declaration of 'strcpy'


2.      “project property” ->“Configuration Properties” -> “Linker”下的选项“Per-userRedirection” 为 “Yes”;

          这样vc9才能通过编译。vc8无此选项。


3.      “project property” ->“Configuration Properties” -> “Custom Build Step” 下的选项“Description” 为“Performing Custom Build Step”;

         清除其它选项的值。vc8默认已经清除。


4.      Vista 下COM的注册必须为administrator模式

         单击”命令提示符”右键”以管理员身份运行”即进入administrator模式

 

热点排行