创建CAA对话框程序的详细步骤

2014-07-28 21:38:57|?次阅读|上传:wustguangh【已有?条评论】发表评论

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

在该类的头文件中:

  • 定义了CAADlgHelloApplication类是继承自CATInteractiveApplication类的子类;
  • 定义了CAADlgHelloApplication类的构造和析构函数;
  • 重写其父类CATInteractiveApplication的函数BeginApplication和EndApplication;
  1. 在“CAADlgHelloApplication.cpp”最终的完整代码如下:
// COPYRIGHT DASSAULT SYSTEMES 2003

#include "CAADlgHelloApplication.h"

#include "CAADlgHelloWindow.h"

//C++ Standard Library

#include <iostream.h>

//-------------------------------------------------------------------------

//-------------------------------------------------------------------------

CAADlgHelloApplication::CAADlgHelloApplication(const CATString& iIdentifier):

                        CATInteractiveApplication(NULL, iIdentifier)

{

  cout << endl <<"The CAADlgHelloApplication begins..... " <<endl << endl;

}

//------------------------------------------------------------------------

CAADlgHelloApplication::~CAADlgHelloApplication()

{

  cout << endl <<"The CAADlgHelloApplication is finished. " <<endl << endl;

}

//------------------------------------------------------------------------

void CAADlgHelloApplication::BeginApplication()

{

  cout <<"CAADlgHelloApplication::BeginApplication" << endl;

  // This window is deleted when the application is deleted.

  // The application is deleted by the Destroy Method called in the

  // CAADlgHelloWindow::Exit method.

  //

  CAADlgHelloWindow * pMainWindow = NULL;

  pMainWindow = new CAADlgHelloWindow(this);

  // Constructs all Dialog'objects of the window

  pMainWindow->Build();

  pMainWindow->SetVisibility(CATDlgShow);

}

//------------------------------------------------------------------------

int CAADlgHelloApplication::EndApplication()

{

  cout << endl << "CAADlgHelloApplication::EndApplication" << endl;

  // OK

  return(0);

}

//------------------------------------------------------------------------

// Application created

CAADlgHelloApplication ApplicationInstance("Hello");
发表评论0条 】
网友评论(共?条评论)..
创建CAA对话框程序的详细步骤