cancel
Showing results for 
Search instead for 
Did you mean: 

DBTools: DBBackup was not working (looking for a better solution)

4,917

Recently, I've tried to update a custom backup program written in Borland C++ Builder from dbtools 9 to dbtools 10, and I've started getting strange error messages. After some investigation using MSVC I discovered that size of chkpt_log_type member in a_backup_db structure is 1 byte in C++B and 4 bytes in MSVC. With my C knowledge being between 'weak' and 'nonexistent', I copied dbtools.h to my project and inserted 3 bytes stuffing after the chkpt_log_type. It did the trick for me, but I am unsure it is the best solution (and if it is correct at all), hence I'm asking for the better option.

Accepted Solutions (1)

Accepted Solutions (1)

VolkerBarth
Contributor

As to the question "What's the size of an enum?", you may have a look at StackOverflow.

AFAIK, the size is partly compiler-dependent, and MSVC seems to use an int whereas C++ only requires the smallest binary size that can store all values - what could be 3 bits in this particular case.

Besides these facts, I can't tell whether this might lead to further problems when compling the DBTools LIB against different compilers. I would suggest to use the fitting LIB (Borland or MS). Note that in SA 11 there's no more support for Borland compilers on Windows plattforms.

Oops, I have to correct myself: There's no more Borland LIB in SA 11 but a .DEF file as substitute.

Answers (0)