当前位置: 代码迷 >> Informix >> Ole与ActiveX,该如何解决
  详细解决方案

Ole与ActiveX,该如何解决

热度:1115   发布时间:2013-02-26 00:00:00.0
Ole与ActiveX
  //---------------------------------------------------------------------------


#pragma hdrstop

#include "DExcelBrokerBase.h"

//---------------------------------------------------------------------------
//构造函数
//只读、只写、读写都可以
DExcelBrokerBase::DExcelBrokerBase( const AnsiString &sFilePath, const EConType eType )
{
    switch( eType )
    {
        case EXCRead:
            s_gFileReadPath = sFilePath;
            break;
        case EXCWrite:
            s_gFileWritePath = sFilePath;
            break;
        case EXCAll:
            s_gFileReadPath = sFilePath;
            s_gFileWritePath = sFilePath;
            break;
        default:
            break;
    }
}

//---------------------------------------------------------------------------
//读写同时
DExcelBrokerBase::DExcelBrokerBase( const AnsiString &sFileReadPath, const AnsiString &sFileWritePath )
{
    s_gFileReadPath     = sFileReadPath;
    s_gFileWritePath    = sFileWritePath;
}


//---------------------------------------------------------------------------
//析构函数
DExcelBrokerBase::~DExcelBrokerBase()
{
    
    //
    if ( !v_gEReadApp.IsEmpty() )
    {
        CloseReadObj();
        v_gEReadApp    = NULL;
    }
    if ( !v_gEReadCell.IsEmpty() )
    {
        v_gEReadCell.Clear();
        v_gEReadCell        = NULL;
    }
    if ( !v_gEReadSheet.IsEmpty() )
    {
        v_gEReadSheet.Clear();
        v_gEReadSheet       = NULL;
    }

    if ( !v_gEReadSingleBook.IsEmpty() )
    {
        v_gEReadSingleBook.Clear();
        v_gEReadSingleBook  = NULL;
    }

    if ( !v_gEReadAllBooks.IsEmpty() )
    {
         v_gEReadAllBooks.Clear();
         v_gEReadAllBooks    = NULL;
    }
    
    //
  相关解决方案