2010年1月3日

摘要: 根据C++ Complete Reference 对如下链接进行勘误http://blog.csdn.net/chief1985/archive/2009/10/23/4720191.aspxhttp://blog.csdn.net/wuliming_sc/archive/2009/01/31/3855607.aspx 阅读全文
posted @ 2010-01-03 15:00 做个不善的人 阅读(183) 评论(0) 推荐(0)
 
摘要: C++中的虚函数的作用主要是实现了多态的机制。关于多态,简而言之就是用父类型别的指针指向其子类的实例,然后通过父类的指针调用实际子类的成员函数。这种技术可以让父类的指针有“多种形态”,这是一种泛型技术。所谓泛型技术,说白了就是试图使用不变的代码来实现可变的算法。比如:模板技术,RTTI技术,虚函数技术,要么是试图做到在编译时决议,要么试图做到运行时决议。虚函数表对C++ 了解的人都应该知道虚函数(Virtual Function)是通过一张虚函数表(Virtual Table)来实现的。简称为V-Table。 在这个表中,主是要一个类的虚函数的地址表,这张表解决了继承、覆盖的问题,保证其容真实 阅读全文
posted @ 2010-01-03 12:48 做个不善的人 阅读(456) 评论(0) 推荐(0)
 

2010年1月2日

摘要: 1. 为什么需要虚析构函数,什么时候需要?看下面的代码:虚析构函数 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->classClxBase{public:ClxBase(){};virtual~ClxBase(){cout<<"OutputfromthedestructorofclassClxBase!"<<endl;};virtualvoidDoSomething(){cout<<& 阅读全文
posted @ 2010-01-02 22:01 做个不善的人 阅读(295) 评论(0) 推荐(0)
 

2009年12月25日

摘要: C++的static有两种用法:面向过程程序设计中的static和面向对象程序设计中的static。前者应用于普通变量和函数,不涉及类;后者主要说明static在类中的作用。 一、面向过程设计中的static 1、静态全局变量 在全局变量前,加上关键字static,该变量就被定义成为一个静态全局变量。静态全局变量有以下特点: 该变量在全局数据区分配内存; 未经初始化的静态全局变量会被程序自动初始化为0(局部变量的值是随机的,除非它被显式初始化); 静态全局变量在声明它的整个文件都是可见的,而在文件之外是不可见的; 全局和静态全局变量只在程序开始运行时初始化; 未初始化的全局和静态全局变... 阅读全文
posted @ 2009-12-25 13:23 做个不善的人 阅读(365) 评论(0) 推荐(0)
 

2009年12月18日

摘要: This milestone, my lead let me drive code coverage. So I need do a planning about this. This is my planning email sent to team: Code Coverage is a good tool to help us get the test coverage status and add test cases according to the code coverage data. We will run two round test passes in Beta. So . 阅读全文
posted @ 2009-12-18 21:14 做个不善的人 阅读(240) 评论(0) 推荐(0)
 

2009年12月12日

摘要: 定义: class B { private: B() { } friend class A; }; 将导致B无法被除A以外的其它任何class直接继承以后实例化,也就是说,在上面这个定义的基础上,如果你再定义: class C:public B{}; 将导致编译能够通过,但是无法实例化C(那当然也没用了,所以间接实现了一个无法继承的类B),但是因为A是B的友元,所以能够进入B的private区域,所以如果定义: class A:public B{}; 能够实例化A. 但是这样定义还有一个漏洞,如果在A普通public继承B的基础上再定义: class D:publ... 阅读全文
posted @ 2009-12-12 19:32 做个不善的人 阅读(371) 评论(0) 推荐(0)
 

2009年12月11日

摘要: 我们在计划的时候其实往往会碰到这样的问题:这个也想做,那个也想做,可是时间不够,这个不想CUT,那个也不想CUT,有时甚至分不清楚哪些重要,重要中的事情中哪些更重要。 如何解决这个问题呢,今天的感觉是... 阅读全文
posted @ 2009-12-11 21:06 做个不善的人 阅读(291) 评论(0) 推荐(0)
 

2009年12月5日

摘要: Using batch parametersYou can use batch parameters anywhere within a batch file to extract information about your environment settings.Cmd.exe provides the batch parameter expansion variables %0 through %9. When you use batch parameters in a batch file, %0 is replaced by the batch file name, and %1 阅读全文
posted @ 2009-12-05 10:47 做个不善的人 阅读(465) 评论(0) 推荐(0)
 

2009年10月30日

摘要: 1. Capture Mouse是怎么回事? UIElement.CaptureMouse() and Mouse.Capture() Capture mouse能够使 即使在控件之外也能够获取鼠标事件,拖,拉鼠标时最有用。 When an element captures the mouse, it receives mouse input whether or not the cursor is within its borders. 释放:UIElement.ReleaseMouseCapture() 或者Mouse.Capture(null) 注意只能获取MouseUp 与MouseD 阅读全文
posted @ 2009-10-30 13:35 做个不善的人 阅读(350) 评论(0) 推荐(0)
 

2009年10月29日

摘要: Drag-and-drop operations typically involve two parties: a drag source from which the dragged object originates and a drop target which receives the dropped object. The drag source and drop target may be the same application or a different application.The type and number of objects that can be manipu 阅读全文
posted @ 2009-10-29 17:21 做个不善的人 阅读(3258) 评论(0) 推荐(0)