CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ObjectARX 开发指南

AcAxOleLinkManager

2022-12-31 12:48| 发布者: admin| 查看: 242| 评论: 0|来自: AutoCAD

AcAxOleLinkManager用于管理从驻留在数据库的对象到其 COM 对象的链接。这是通过将瞬态反应器连接到该反应堆来完成的。瞬态反应器有一个变量,其中包含指向 COM 对象的指针。这个瞬态反应器也用于调用何时修改。AcDbObjectIUnknownIAcadBaseObject::OnModified()AcDbObject

AutoCAD 在每个会话中维护一个实例。若要获取指向 OLE 链接管理器的指针,请使用函数。在oleaprot.h文件中声明的类描述如下:AcAxOleLinkManagerAcAxGetOleLinkManager()AcAxOleLinkManager

// AcAxOleLinkManager is used to maintain the link between ARX
// objects and their respective COM wrapper.
//
class AcAxOleLinkManager
{
public:
    // Given a pointer to a database-resident object, return
    // the IUnknown of the COM wrapper. NULL is returned if
    // no wrapper is found.
    //
    virtual IUnknown* GetIUnknown(AcDbObject* pObject) = 0;
    // Set the link between a database-resident object and a 
    // COM wrapper. If the IUnknown is NULL, then the link 
    // is removed.
    //
    virtual Adesk::Boolean SetIUnknown(AcDbObject* pObject,
        IUnknown* pUnknown) = 0;
    // Given a pointer to a database object, return
    // the IUnknown of the COM wrapper. NULL is returned if
    // no wrapper is found.
    //
    virtual IUnknown* GetIUnknown(AcDbDatabase* pDatabase) = 0;
    // Set the link between a database object and a COM wrapper. 
    // If the IUnknown is NULL, then the link is removed.
    //
    virtual Adesk::Boolean SetIUnknown(AcDbDatabase* pDatabase,
        IUnknown* pUnknown) = 0;
    // Given a pointer to a database object, return the
    // IDispatch of the document object. NULL is returned if
    // the database does not belong to a particular document.
    //
    virtual IDispatch* GetDocIDispatch(AcDbDatabase* pDatabase)= 0;
    // Set the link between a database object and the IDispatch
    // of the document it belongs to. If the IDispatch is NULL, then 
    // the link is removed.
    //
    virtual Adesk::Boolean SetDocIDispatch(AcDbDatabase* pDatabase,
        IDispatch* pDispatch) = 0;
};

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-19 14:31

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部