C++ Builder 參考手冊 ? IInterface
System::IInterface 是增加了獲取智能接口的 IUnknown。
- System::IInterface 簡介
- System::IInterface 成員
一. System::IInterface 簡介
System::IInterface 是增加了獲取智能接口的 IUnknown。
- 繼承關(guān)系:
IUnknown
?╙ System::IInterface - 頭文件:
#include <sysmac.h> - 命名空間:
System - System::IInterface 是繼承 IUnknown,在 IUnknown 的基礎(chǔ)上,增加了一個 Supports 方法,用于獲取 DelphiInterface 模板的智能接口;
- 可以認(rèn)為 System::IInterface 就是 IUnknown,他們有同樣的 UUID,僅僅是增加了一個 Supports 方法:
__interface INTERFACE_UUID("00000000-0000-0000-C000-000000000046") IInterface : public IUnknown
{
public:
template <typename T>
bool Supports(DelphiInterface<T>& smartIntf)
{
return QueryInterface(__uuidof(T), reinterpret_cast<void**>(static_cast<T**>(&smartIntf))) == S_OK;
}
};
二. System::IInterface 成員
| 成員函數(shù) | 說明 |
|---|---|
| public: | ? |
| Supports | 獲取 DelphiInterface 模板的智能接口 |
| IUnknown:: | 從 IUnknown 繼承過來的 |
| public: | ? |
| AddRef | 增加引用計數(shù) |
| QueryInterface | 返回當(dāng)前組件所支持的 COM 接口的引用 |
| Release | 減少引用計數(shù) / 銷毀對象 |
參考:
- System::_di_IInterface
- System::DelphiInterface
- System::Classes::TComponent
- System::Classes::TInterfacedPersistent
- System::Classes::TPersistent
- System::Syncobjs::TSynchroObject
- System::TCppInterfacedObject
- System::TInterfacedObject
- System::TObject
- VCL 類繼承關(guān)系
C++ Builder 參考手冊 ? IInterface