Liberar recursos no administrados del libro con C++

Contents
[ ]

Workbook objeto ahora implementa la interfaz IDisposable que tiene un método único Dispose(). Puedes llamar directamente al método Workbook.Dispose() o puedes usar la instrucción Using para llamar a este método automáticamente.

#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;

int main()
{
    Aspose::Cells::Startup();

    // Create workbook object
    Workbook wb1;

    // Call Dispose method
    wb1.Dispose();

    // Call Dispose method via RAII (Resource Acquisition Is Initialization)
    {
        Workbook wb2;
        // Any other code goes here
    } // wb2 is automatically disposed when it goes out of scope

    Aspose::Cells::Cleanup();
}