代码改变世界

随笔档案-2012年12月21日

VS中Debug版本和Release版本的区别

2012-12-21 21:26 by java20130722, 403 阅读, 收藏,
摘要: Debug通常称为调试版本,它包含调试信息,并且不作任何优化,便于程序员调试程序。Release称为发布版本,它往往是进行了各种优化,使得程序在代码大小和运行速度上都是最优的,以便用户很好地使用。Debug 和 Release 的真正秘密,在于一组编译选项。下面列出了分别针对二者的选项(当然除此之外还有其他一些,如/Fd /Fo,但区别并不重要,通常他们也不会引起 Release 版错误,在此不讨论)Debug 版本参数含义/MDd /MLd 或 /MTd 使用 Debug runtime library (调试版本的运行时刻函数库)/Od 关闭优化开关 /D "_DEBUG&quo 阅读全文

CloseHandle()函数的使用

2012-12-21 16:48 by java20130722, 591 阅读, 收藏,
摘要: CloseHandle()函数的使用很多程序在创建线程都这样写的:............ThreadHandle = CreateThread(NULL,0,.....);CloseHandel(ThreadHandle );。。。。。这不是刚好创建又关闭了吗?线程怎么运行呢?答:Closing a thread handle does not terminatethe associated thread. To remove a thread object, you must terminate thethread, then close all handles to the thread 阅读全文