是首先是VM表,但是和COM相关的函数地址都废弃了,这几个VM函数具体放在哪里,还得在研究:

  1. { Virtual method table entries }
  2.  
  3. vmtSelfPtr = -;
  4. vmtIntfTable = -;
  5. vmtAutoTable = -;
  6. vmtInitTable = -;
  7. vmtTypeInfo = -;
  8. vmtFieldTable = -;
  9. vmtMethodTable = -;
  10. vmtDynamicTable = -;
  11. vmtClassName = -;
  12. vmtInstanceSize = -;
  13. vmtParent = -;
  14. vmtSafeCallException = - deprecated; // don't use these constants.
  15. vmtAfterConstruction = - deprecated; // use VMTOFFSET in asm code instead
  16. vmtBeforeDestruction = - deprecated;
  17. vmtDispatch = - deprecated;
  18. vmtDefaultHandler = - deprecated;
  19. vmtNewInstance = - deprecated;
  20. vmtFreeInstance = - deprecated;
  21. vmtDestroy = - deprecated;
  22.  
  23. vmtQueryInterface = deprecated;
  24. vmtAddRef = deprecated;
  25. vmtRelease = deprecated;
  26. vmtCreateObject = deprecated;

其次是所有与COM相关的声明与定义:

  1. type
  2.  
  3. TObject = class;
  4.  
  5. TClass = class of TObject;
  6.  
  7. HRESULT = type Longint; { from WTYPES.H }
  8. {$EXTERNALSYM HRESULT}
  9.  
  10. PGUID = ^TGUID;
  11. TGUID = packed record
  12. D1: LongWord;
  13. D2: Word;
  14. D3: Word;
  15. D4: array[..] of Byte;
  16. end;
  17.  
  18. PInterfaceEntry = ^TInterfaceEntry;
  19. TInterfaceEntry = packed record
  20. IID: TGUID;
  21. VTable: Pointer;
  22. IOffset: Integer;
  23. ImplGetter: Integer;
  24. end;
  25.  
  26. PInterfaceTable = ^TInterfaceTable;
  27. TInterfaceTable = packed record
  28. EntryCount: Integer;
  29. Entries: array[..] of TInterfaceEntry;
  30. end;
  31.  
  32. TMethod = record
  33. Code, Data: Pointer;
  34. end;
  35.  
  36. const
  37. S_OK = ; {$EXTERNALSYM S_OK}
  38. S_FALSE = $; {$EXTERNALSYM S_FALSE}
  39. E_NOINTERFACE = HRESULT($); {$EXTERNALSYM E_NOINTERFACE}
  40. E_UNEXPECTED = HRESULT($8000FFFF); {$EXTERNALSYM E_UNEXPECTED}
  41. E_NOTIMPL = HRESULT($); {$EXTERNALSYM E_NOTIMPL}
  42.  
  43. type
  44. IInterface = interface
  45. ['{00000000-0000-0000-C000-000000000046}']
  46. function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
  47. function _AddRef: Integer; stdcall;
  48. function _Release: Integer; stdcall;
  49. end;
  50.  
  51. IUnknown = IInterface;
  52. {$M+}
  53. IInvokable = interface(IInterface)
  54. end;
  55. {$M-}
  56.  
  57. IDispatch = interface(IUnknown)
  58. ['{00020400-0000-0000-C000-000000000046}']
  59. function GetTypeInfoCount(out Count: Integer): HResult; stdcall;
  60. function GetTypeInfo(Index, LocaleID: Integer; out TypeInfo): HResult; stdcall;
  61. function GetIDsOfNames(const IID: TGUID; Names: Pointer;
  62. NameCount, LocaleID: Integer; DispIDs: Pointer): HResult; stdcall;
  63. function Invoke(DispID: Integer; const IID: TGUID; LocaleID: Integer;
  64. Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult; stdcall;
  65. end;
  66.  
  67. {$EXTERNALSYM IUnknown}
  68. {$EXTERNALSYM IDispatch}
  69.  
  70. { TInterfacedObject provides a threadsafe default implementation
  71. of IInterface. You should use TInterfaceObject as the base class
  72. of objects implementing interfaces. }
  73.  
  74. TInterfacedObject = class(TObject, IInterface)
  75. protected
  76. FRefCount: Integer;
  77. function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
  78. function _AddRef: Integer; stdcall;
  79. function _Release: Integer; stdcall;
  80. public
  81. procedure AfterConstruction; override;
  82. procedure BeforeDestruction; override;
  83. class function NewInstance: TObject; override;
  84. property RefCount: Integer read FRefCount;
  85. end;
  86.  
  87. TInterfacedClass = class of TInterfacedObject;
  88.  
  89. { TAggregatedObject and TContainedObject are suitable base
  90. classes for interfaced objects intended to be aggregated
  91. or contained in an outer controlling object. When using
  92. the "implements" syntax on an interface property in
  93. an outer object class declaration, use these types
  94. to implement the inner object.
  95.  
  96. Interfaces implemented by aggregated objects on behalf of
  97. the controller should not be distinguishable from other
  98. interfaces provided by the controller. Aggregated objects
  99. must not maintain their own reference count - they must
  100. have the same lifetime as their controller. To achieve this,
  101. aggregated objects reflect the reference count methods
  102. to the controller.
  103.  
  104. TAggregatedObject simply reflects QueryInterface calls to
  105. its controller. From such an aggregated object, one can
  106. obtain any interface that the controller supports, and
  107. only interfaces that the controller supports. This is
  108. useful for implementing a controller class that uses one
  109. or more internal objects to implement the interfaces declared
  110. on the controller class. Aggregation promotes implementation
  111. sharing across the object hierarchy.
  112.  
  113. TAggregatedObject is what most aggregate objects should
  114. inherit from, especially when used in conjunction with
  115. the "implements" syntax. }
  116.  
  117. TAggregatedObject = class(TObject)
  118. private
  119. FController: Pointer; // weak reference to controller
  120. function GetController: IInterface;
  121. protected
  122. { IInterface }
  123. function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
  124. function _AddRef: Integer; stdcall;
  125. function _Release: Integer; stdcall;
  126. public
  127. constructor Create(const Controller: IInterface);
  128. property Controller: IInterface read GetController;
  129. end;
  130.  
  131. { TContainedObject is an aggregated object that isolates
  132. QueryInterface on the aggregate from the controller.
  133. TContainedObject will return only interfaces that the
  134. contained object itself implements, not interfaces
  135. that the controller implements. This is useful for
  136. implementing nodes that are attached to a controller and
  137. have the same lifetime as the controller, but whose
  138. interface identity is separate from the controller.
  139. You might do this if you don't want the consumers of
  140. an aggregated interface to have access to other interfaces
  141. implemented by the controller - forced encapsulation.
  142. This is a less common case than TAggregatedObject. }
  143.  
  144. TContainedObject = class(TAggregatedObject, IInterface)
  145. protected
  146. { IInterface }
  147. function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall;
  148. end;

里面的英文说明还得翻译如下:

System单元对所有与COM相关的声明就这么多,需要倒背如流的更多相关文章

  1. SQLite 对中文路径的支持(用到了StringToWideChar和Utf8Encode在D7的System单元中自带)

    最近用SQLITE作为数据库,发现,如果直接传递带中文路径或文件名的数据库,会导致无法打开数据库的情况.看了一下SQLITE的源码,才发现,原来SQLITE中是用UTF8编码进行文件打开操作的. 所以 ...

  2. IIS 无法读取配置节"system.web.extensions",由于它缺少节声明

    作者:jiankunking 出处:http://blog.csdn.net/jiankunking 今天在本地安装iis.搭建站点,应用程序的时候报错以下的错误: server错误 Internet ...

  3. .net学习笔记----利用System.Drawing.Image类进行图片相关操作

    C#中对图片的操作主要是通过System.Drawing.Image等类进行. 一.将图片转换为字节流 /// <summary> /// 图片处理帮助类 /// </summary ...

  4. Delphi数组复制(只能使用System单元的Move函数)

    const AA : arrary[..] ,,,,) var BB : arrary[..] of byte; begin BB := AA ; {这样是错误的} Move(AA,BB,sizeof ...

  5. Delphi “Invalid floating point operation.”错误的解决方法(使用System单元提供的Set8087CW函数禁用浮点异常)

    这两天用webbrower写东西,有时候打开SSL加密网站时会出现”Invalid floating point operation.”的错误,上网搜了下,把解决方法贴上. 导致原因 在Delphi2 ...

  6. 单击Gridview中LinkButton,获取当前行索引及某单元格值,进行相关处理

    1.在Gridview中添加模板列,在其中加入Linkbuttion,增加CommandName属性 (设置命令名),并赋值 <asp:TemplateField HeaderText=&quo ...

  7. 使用http.sys,让delphi 的多层服务飞起来

    核心提示:一直以来,delphi 的网络通讯层都是以indy 为主,虽然indy 的功能非常多,涉及到网络服务的各个方面,但是对于大多数多层服务来说,就是需要一个快速.稳定.高效的传输层.Delphi ...

  8. linux基础-基本命令的讲解(1-7单元)

    基本命令的讲解 主要内容介绍 1.LINUX操作系统安装及初始化配置(熟悉):2.LINUX操作系统目录组成结构及文件级增删改查操作(重点):3.LINUX操作系统用户.权限管理(重点):4.开源软件 ...

  9. Delphi XE5教程7:单元引用和uses 子句

    内容源自Delphi XE5 UPDATE 2官方帮助<Delphi Reference>,本人水平有限,欢迎各位高人修正相关错误! 也欢迎各位加入到Delphi学习资料汉化中来,有兴趣者 ...

随机推荐

  1. VS2010 安装 Boost 库 1.54

    Boost库被称为C++准标准库, 功能很是强大, 下面记录我在VS2010中安装使用Boost库的过程. 首先上官网http://www.boost.org/下载最新的Boost库, 我的版本是1_ ...

  2. hdu 1102 Constructing Roads(最小生成树 Prim)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1102 Problem Description There are N villages, which ...

  3. Swift - 获取字符串的MD5值

    MD5即Message-Digest Algorithm 5(信息-摘要算法5),用于确保信息传输完整一致.是计算机广泛使用的杂凑算法之一(又译摘要算法.哈希算法),主流编程语言普遍已有MD5实现. ...

  4. 利用d3.js绘制中国地图

    d3.js是一个比較强的数据可视化js工具. 利用它画了一幅中国地图,例如以下图所看到的: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvc3ZhcDE=/ ...

  5. Delphi XE7下如何创建一个Android模拟器调试

    利用Delphi XE7我们可以进行多种设备程序的开发,尤其是移动开发应用程序得到不断地加强.在实际的Android移动程序开发中,如果我们直接用android真机直接调试是非常不错.一是速度快,二是 ...

  6. Project configuration is not up-to-date with pom.xml错误解决方法

    导入一个Maven项目之后发现有一个如下的错误: Project configuration is not up-to-date with pom.xml. Run project configura ...

  7. Java_1Lesson

    cmd使用 进入硬盘分区:D: E: F: 查看目录 dir 进入文件夹 “cd 文件名” .使用javac编译器编译运行. Javac 文件名 运行java程序 Java 文件名 第一个程序 pub ...

  8. POJ 1042 Gone Fishing (贪心)(刘汝佳黑书)

    Gone Fishing Time Limit: 2000MS   Memory Limit: 32768K Total Submissions: 30281   Accepted: 9124 Des ...

  9. Android播放音乐时跳动的屏谱demo

    Android实现播放音频时的跳动频谱,并实现可以调节的均衡器. Main.java package com.wjq.audiofx; import android.app.Activity; imp ...

  10. net core与golang web

    Asp.net core与golang web简单对比测试 最近因为工作需要接触了go语言,又恰好asp.net core发布RC2,就想简单做个对比测试. 下面是测试环境: CPU:E3-1230 ...