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

时间:2023-02-16 23:04:39

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

{ Virtual method table entries }

  vmtSelfPtr           = -;
vmtIntfTable = -;
vmtAutoTable = -;
vmtInitTable = -;
vmtTypeInfo = -;
vmtFieldTable = -;
vmtMethodTable = -;
vmtDynamicTable = -;
vmtClassName = -;
vmtInstanceSize = -;
vmtParent = -;
vmtSafeCallException = - deprecated; // don't use these constants.
vmtAfterConstruction = - deprecated; // use VMTOFFSET in asm code instead
vmtBeforeDestruction = - deprecated;
vmtDispatch = - deprecated;
vmtDefaultHandler = - deprecated;
vmtNewInstance = - deprecated;
vmtFreeInstance = - deprecated;
vmtDestroy = - deprecated; vmtQueryInterface = deprecated;
vmtAddRef = deprecated;
vmtRelease = deprecated;
vmtCreateObject = deprecated;

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

type

  TObject = class;

  TClass = class of TObject;

  HRESULT = type Longint;  { from WTYPES.H }
{$EXTERNALSYM HRESULT} PGUID = ^TGUID;
TGUID = packed record
D1: LongWord;
D2: Word;
D3: Word;
D4: array[..] of Byte;
end; PInterfaceEntry = ^TInterfaceEntry;
TInterfaceEntry = packed record
IID: TGUID;
VTable: Pointer;
IOffset: Integer;
ImplGetter: Integer;
end; PInterfaceTable = ^TInterfaceTable;
TInterfaceTable = packed record
EntryCount: Integer;
Entries: array[..] of TInterfaceEntry;
end; TMethod = record
Code, Data: Pointer;
end; const
S_OK = ; {$EXTERNALSYM S_OK}
S_FALSE = $; {$EXTERNALSYM S_FALSE}
E_NOINTERFACE = HRESULT($); {$EXTERNALSYM E_NOINTERFACE}
E_UNEXPECTED = HRESULT($8000FFFF); {$EXTERNALSYM E_UNEXPECTED}
E_NOTIMPL = HRESULT($); {$EXTERNALSYM E_NOTIMPL} type
IInterface = interface
['{00000000-0000-0000-C000-000000000046}']
function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
function _AddRef: Integer; stdcall;
function _Release: Integer; stdcall;
end; IUnknown = IInterface;
{$M+}
IInvokable = interface(IInterface)
end;
{$M-} IDispatch = interface(IUnknown)
['{00020400-0000-0000-C000-000000000046}']
function GetTypeInfoCount(out Count: Integer): HResult; stdcall;
function GetTypeInfo(Index, LocaleID: Integer; out TypeInfo): HResult; stdcall;
function GetIDsOfNames(const IID: TGUID; Names: Pointer;
NameCount, LocaleID: Integer; DispIDs: Pointer): HResult; stdcall;
function Invoke(DispID: Integer; const IID: TGUID; LocaleID: Integer;
Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult; stdcall;
end; {$EXTERNALSYM IUnknown}
{$EXTERNALSYM IDispatch} { TInterfacedObject provides a threadsafe default implementation
of IInterface. You should use TInterfaceObject as the base class
of objects implementing interfaces. } TInterfacedObject = class(TObject, IInterface)
protected
FRefCount: Integer;
function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
function _AddRef: Integer; stdcall;
function _Release: Integer; stdcall;
public
procedure AfterConstruction; override;
procedure BeforeDestruction; override;
class function NewInstance: TObject; override;
property RefCount: Integer read FRefCount;
end; TInterfacedClass = class of TInterfacedObject; { TAggregatedObject and TContainedObject are suitable base
classes for interfaced objects intended to be aggregated
or contained in an outer controlling object. When using
the "implements" syntax on an interface property in
an outer object class declaration, use these types
to implement the inner object. Interfaces implemented by aggregated objects on behalf of
the controller should not be distinguishable from other
interfaces provided by the controller. Aggregated objects
must not maintain their own reference count - they must
have the same lifetime as their controller. To achieve this,
aggregated objects reflect the reference count methods
to the controller. TAggregatedObject simply reflects QueryInterface calls to
its controller. From such an aggregated object, one can
obtain any interface that the controller supports, and
only interfaces that the controller supports. This is
useful for implementing a controller class that uses one
or more internal objects to implement the interfaces declared
on the controller class. Aggregation promotes implementation
sharing across the object hierarchy. TAggregatedObject is what most aggregate objects should
inherit from, especially when used in conjunction with
the "implements" syntax. } TAggregatedObject = class(TObject)
private
FController: Pointer; // weak reference to controller
function GetController: IInterface;
protected
{ IInterface }
function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
function _AddRef: Integer; stdcall;
function _Release: Integer; stdcall;
public
constructor Create(const Controller: IInterface);
property Controller: IInterface read GetController;
end; { TContainedObject is an aggregated object that isolates
QueryInterface on the aggregate from the controller.
TContainedObject will return only interfaces that the
contained object itself implements, not interfaces
that the controller implements. This is useful for
implementing nodes that are attached to a controller and
have the same lifetime as the controller, but whose
interface identity is separate from the controller.
You might do this if you don't want the consumers of
an aggregated interface to have access to other interfaces
implemented by the controller - forced encapsulation.
This is a less common case than TAggregatedObject. } TContainedObject = class(TAggregatedObject, IInterface)
protected
{ IInterface }
function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall;
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 &OpenCurlyDoubleQuote;Invalid floating point operation&period;”错误的解决方法(使用System单元提供的Set8087CW函数禁用浮点异常)

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

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

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

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

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

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

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

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

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

随机推荐

  1. 玩转AR,联想将在2017年推出第二款Tango AR手机

    今年6月份,联想与谷歌合作推出了全球首款消费级AR手机Phab2 Pro,并获得很大的关注.作为谷歌Project Tango的一部分,这款手机的最大亮点是它搭载了三颗后置摄像头和多个传感器,机身背面 ...

  2. JavaScript设计模式 - 单例模式

    单例模式:保证一个类仅有一个实例,并提供一个访问它的全局访问点. 一.实现一个标准的单例模式,用一个变量来标志当前是否已经为某个类创建过对象, 如果是,则在下一次获取该对象实例时,直接返回之前创建的对 ...

  3. - 高级篇:二&comma;IL设置静态属性&comma;字段和类型转换

    - 高级篇:二,IL设置静态属性,字段和类型转换 静态属性赋值 先来看 Reflector反射出的IL源码(感谢Moen的提示),这次用 Release模式编译,去掉那些无用的辅助指令 public ...

  4. Jquery 源码学习

    https://www.youtube.com/watch?v=qeMFEz_ufZc http://*.com/questions/7194784/analysing-the ...

  5. nginx : server&lowbar;name localhost 和 chrome : Provisional headers are shown

    问题相关问题现象:解决思路解决方案总结 问题相关 nginx : server_name localhost chrome : Provisional headers are shown 问题现象: ...

  6. 20175208 张家华 MyOD

    一.实现目的: 编写MyOD.java 用java MyOD XXX实现Linux下od -tx -tc XXX的功能 二.功能简介 1.Linux下的od功能是将指定文件内容以八进制.十进制.十六进 ...

  7. roslaunch &amp&semi; gdb 调试指南(待补充)

    1. 安装xterm sudo apt-get install xterm 2. 在launch文件中添加如下内容: <node name="navigation" pkg= ...

  8. 【hadoop】 hdfs shell 命令交互

    1.put 本地文件上传至hdfs中 2. cat 查看内容 3. 删除文件,文件夹 4. ls 5. copyFromLocal 复制本地文件到HDFS , copyToLocal hdfs 复制到 ...

  9. Win10系列:JavaScript综合实例2

    在项目中添加一个名为pages的文件夹,并在pages文件夹里面再添加一个名为mainPage的文件夹,接着在mainPage文件夹里添加一个"页面控制"项,命名为mainPage ...

  10. Oracle 批量修改某个用户下表的表空间

    说明:一般来说要修改表的表空间需要同时修改表的表空间和其对应的索引表空间,并且在修改含有BOLB字段的表的表空间时又不一样,具体请参考末尾的链接 思路:拼凑一个满足条件的批处理查询语句,将查询的结果复 ...