brechtsanders / xlsxio

XLSX I/O - C library for reading and writing .xlsx files
MIT License
417 stars 112 forks source link

what does 75B9F350 error code mean? #51

Closed kekersdev closed 5 years ago

kekersdev commented 5 years ago

I'm using slightly modified example code

std::string analyze(path filename)
{
    int c = 0;
    xlsxioreader reader;
    std::string result;

    reader = xlsxioread_open(filename.string().c_str());
    if (reader == NULL)
    {
        std::cout << stderr << " error opening file " << filename << std::endl;
        return result;
    }

    xlsxioreadersheetlist sheetlist;
    if ((sheetlist = xlsxioread_sheetlist_open(reader)) != NULL)
    {
        while ((xlsxioread_sheetlist_next(sheetlist)) != NULL)
        {
            c++;
        }
        xlsxioread_sheetlist_close(sheetlist);
        std::cout << filename.string() << " contains " << c << " sheets" << std::endl;
    }
    return result;
}
brechtsanders commented 5 years ago

Are you seeing any other errors above that line? Did the file exist and was it readable and free from locks (e.g. not open in some archive tool)?

kekersdev commented 5 years ago

It reads some files correctly but then the error apears and files are not reading anymore Files are readable and free from locks image

brechtsanders commented 5 years ago

Are you matching each open with a close? For example: the code you posted doesn't include xlsxioread_close()

kekersdev commented 5 years ago

Yeah i forgot it somehow Now it works, thanks a lot