美文网首页
DelphiInterface - C++ Builder

DelphiInterface - C++ Builder

作者: 玄坴 | 来源:发表于2020-05-22 13:17 被阅读0次

C++ Builder 参考手册DelphiInterface


System::DelphiInterface 是可以管理引用计数和自动销毁接口对象的智能接口模板类型。

  • System::DelphiInterface 简介
  • System::DelphiInterface 成员

一. System::DelphiInterface 简介

System::DelphiInterface 是可以管理引用计数和自动销毁接口对象的智能接口模板类型。

  • 继承关系:无
  • 头文件:#include <systobj.h>
  • 命名空间:System
template <class T> class DelphiInterface;

模板参数

  • 模板参数为期望接管的接口类型
  • 模板参数通常为 System::IInterface,即 System::_di_IInterface
  • 模板参数 IDispatch 和 IUnknown 也较为常用,即 - System::_di_IDispatch 和 System::_di_IUnknown

二. System::DelphiInterface 成员

成员函数 说明
public:  
DelphiInterface 构造函数
~DelphiInterface 析构函数
operator ! 如果管理的接口为 NULL 返回 true,否则 false
operator & 直接返回被管理的接口指针的地址 (指针的指针)
operator () 直接返回被管理的接口
operator * 直接返回被管理的接口
operator = 赋值操作符,放弃当前管理的接口,接管新的接口
operator -> 指针操作符,用于访问被管理的接口的成员
Release 放弃对接口的管理

参考:


C++ Builder 参考手册DelphiInterface

相关文章

网友评论

      本文标题:DelphiInterface - C++ Builder

      本文链接:https://www.haomeiwen.com/subject/avdnnhtx.html