QAxObjectInterface Class
QAxObjectInterface 是一个提供QAxObject 和QAxWidget 公共属性的接口。更多
头文件: | #include <QAxObjectInterface> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS AxContainer) target_link_libraries(mytarget PRIVATE Qt6::AxContainer) |
qmake: | QT += axcontainer |
自 | Qt 6.0 |
继承: |
公共函数
virtual | ~QAxObjectInterface() |
virtual ulong | classContext() const = 0 |
virtual QString | control() const = 0 |
virtual void | resetControl() = 0 |
virtual void | setClassContext(ulong classContext) = 0 |
virtual bool | setControl(const QString &c) = 0 |
成员函数文档
[virtual noexcept]
QAxObjectInterface::~QAxObjectInterface()
[pure virtual]
ulong QAxObjectInterface::classContext() const
返回 ActiveX 控件运行的上下文(默认为 CLSCTX_SERVER)。
另请参阅 setClassContext(),QAxBaseWidget::classContext, 和QAxBaseObject::classContext 。
[pure virtual]
QString QAxObjectInterface::control() const
返回由QAxBase 对象封装的 COM 对象的名称。
另请参阅 setControl(),QAxBaseWidget::control, 和QAxBaseObject::control 。
[pure virtual]
void QAxObjectInterface::resetControl()
断开连接并销毁 COM 对象。
另请参阅 QAxBaseWidget::control 和QAxBaseObject::control 。
[pure virtual]
void QAxObjectInterface::setClassContext(ulong classContext)
设置 ActiveX 控件运行的上下文。classContext
影响调用 CoCreateInstance 时的 "dwClsContext "参数。这可用于控制支持两种启动方式的控件在程序内启动与在程序外启动。此外,当与 CLSCTX_ENABLE_CLOAKING 和冒充令牌一起使用时,它还可用于修改/减少控制权限。
请注意,该函数必须在setControl() 之前调用才能生效。
另请参阅 QAxBaseWidget::classContext 和QAxBaseObject::classContext 。
[pure virtual]
bool QAxObjectInterface::setControl(const QString &c)
返回 COM 对象设置是否成功。
将此QAxBase 对象封装的 COM 对象名称设置为c 。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.