探索C++的底层机制 在看这篇文章之前,请你先要明白一点:那就是c++为我们所提供的各种存取控制仅仅是在编译阶段给我们的限制,也就是说是编译器确保了你在完成任务之前的正确行为,如果你的行为不正确,那么你休想构造出任何可执行程序来。但如果真正到了产生可执行代码阶段,无论是c,c++,还是pascal, Read More
posted @ 2014-05-05 23:26 findumars Views(791) Comments(0) Diggs(0)
段寄存器是因为对内存的分段管理而设置的。16位CPU有四个段寄存器,其程序可同时访问四个不同含义的段,引用方面有如下规定:1. 取命令:段寄存器CS指向存放程序的内存段,IP是用来存放下条待执行的指令在该段的偏移量,把它们合在一起可在该内存段内取到下次要执行的指令。2. 取堆栈:段寄存器SS指向用于... Read More
posted @ 2014-05-04 23:55 findumars Views(6627) Comments(0) Diggs(0)
好奇一下。看来Object Pascal确实与Windows深入结合了。 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, St Read More
posted @ 2014-05-01 19:49 findumars Views(676) Comments(0) Diggs(0)
测试,在按钮事件里写上 Button1.Repaint;(包括TWinControl.Invalidate;和procedure TWinControl.Update;两个函数,会被TButton所继承),跟踪一下就什么都明白了。 1. 执行TWinControl.Invalidate;后,执行Pe Read More
posted @ 2014-05-01 18:41 findumars Views(944) Comments(0) Diggs(0)
构造函数不能是虚函数。但有时候确实需要能传递一个指向基类对象的指针,并且有已创建的派生类对象的拷贝。通常在类内部创建一个Clone()方法,并设置为虚函数。//Listing 12.11 Virtual copy constructor#include using namespace std;cla... Read More
posted @ 2014-04-28 22:38 findumars Views(2491) Comments(0) Diggs(0)