当前位置:首页 » 软件开发
开发技术指南» 文章正文
    引言: TStream 使用了下面的代码,强制子类必须implemen
 

 

    摘要:  < 想法 >  软件的“换肤”技术早已不是什么新鲜事了,但细心的朋友一定已经发现了,现在正悄悄地流行了一种新的改善视觉效果的方法——这里我斗胆定义为“换肤色”技术吧!用过winamp 5、windows mediaplay 9、msn messenger 6、qq2004这些新版本软件了吧,呵呵,全都采用了所谓换汤不换药的“换肤色”技术。挺有意思是吧,下面我们就“自己动手,丰衣足食......
    摘要: 以下内容转自:http://www.drbob42.com/examines/examin55.htm delphi 8 for .net assemblies; packages and librariesin this article, bob swart will explain what .net assemblies are, how we can use them in delph......


[vcl源码精华]之[borland工程师如何保证父类(TStream)的两个overload的seek,至少有一个必须被override]

tstream 使用了下面的代码,强制子类必须implement两个seek方法中至少一个

【程序编程相关:ShadowStar CodeFast

【推荐阅读:关于COM+的一些细节问题

首先说明tstream有两个seek方法 【扩展信息:ShadowStar CodeFast

classes.pas 单元4904行@delphi7

function seek(offset: longint; origin: word): longint; overload; virtual; //叫它seek1

function seek(const offset: int64; origin: tseekorigin): int64; overload; virtual;//叫它seek2

看看如何实现的

function tstream.seek(offset: longint; origin: word): longint;

  procedure raiseexception;

  begin

    raise estreamerror.createresfmt(@sseeknotimplemented, [classname]);

  end;

type 

   //声明了一个seek2样式的函数类型

  tseek64 = function (const offset: int64; origin: tseekorigin): int64 of object;

var 

   //impl是子类的seek2方法,base是tstream的seek2方法

  impl: tseek64;

  base: tseek64;

  clasststream: tclass;

begin


...   下一页
 ·singleton之我见    »显示摘要«
    摘要: 先和大家说说什么是singleton模式的,它中文意应该为单一模式,但好别扭,也不知道是谁翻译的 29796428(qiubole) 12:26:46它属于创建模式的一种 29796428(qiubole) 12:27:00主要的作用就是确实一个类有且只有唯一的一个实例 29796428(qiubole) 12:27:10这在实际当中,其实还是有一些用处的 29796428(qiubole) 1......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE