理解使用CAA创建组件(Creating Components)

理解使用CAA创建组件(Creating Components)

2014-07-16 21:53:19|?次阅读|上传:wustguangh【已有?条评论】发表评论

关键词:CAA, CATIA|来源:唯设编程网

结果源文件CATIData.cpp如下所示:

// C++ generated interface class source file

#include "CATIData.h"

IID IID_CATIData = { 0x7db286f1, 0x218d, 0x0000,

    {0x02, 0x80, 0x02, 0x0a, 0x86, 0x00, 0x00, 0x00} };

CATImplementInterface(CATIData, CATBaseUnknown);

 

MyDataExtension类实现了这个接口:

//include "CATBaseUnknown.h"

 

class MyDataExtension : public CATBaseUnknown {

  CATDeclareClass;

  public :

    MyDataExtension();

    virtual ~MyDataExtension();

    virtual HRESULT __stdcall get_Length(int * oLength);

    virtual HRESULT __stdcall set_Length(int iLength);

  private :

    int _Length;

};

 

CAAEDataExtension类的源文件如下所示:

//include "CAAEDataExtension.h"

 

CATImplementClass(CAAEDataExtension, // Extension class name

                  DataExtension,     // Data extension

                  CATBaseUnknown,    // Always OM-derive extensions from CATBaseUnknown

                  MyObject);         // Main class of the extended component

 

#include "TIE_CATIData.h"

TIE_CATIData(CAAEDataExtension);

 

CAAEDataExtension::CAAEDataExtension() {}

CAAEDataExtension::~CAAEDataExtension() {}

 

HRESULT CAAEDataExtension::get_Length(int * oLength)

{ oLength = _Length; return S_OK; }

 

HRESULT CAAEDataExtension::set_Length(int iLength)

{ _Length = iLength; return S_OK; }

 
发表评论0条 】
网友评论(共?条评论)..
理解使用CAA创建组件(Creating Components)