Many API newbies are translating the BOOL data-type in C to boolean in LB, which is not correct.
BOOL is 32-bit, where boolean is only 16-bit.
The correct translation for BOOL is long.
If one doesn't follow this he is likely to get a general protection violation error, which in turn is usually an overflow error, since the API function tries to return more then the data-type can handle.
Below find a small example showing the length of each of the LB API data-types.
struct testc, c as char
struct tests, s as short
struct testb, b as boolean
struct testw, w as word
struct testl, l as long
struct testp, p$ as ptr
struct testst, tests as struct
struct testd, d as double
print "Length of data types in bytes, for bits multiply by 8"
print "char .... "; len(testc.struct)
print "(u)short ... "; len(tests.struct)
print "boolean .... "; len(testb.struct)
print "word ....... "; len(testw.struct)
print "(u)long .... "; len(testl.struct)
print "pointer .... "; len(testp.struct)
print "struct ..... "; len(testst.struct)
print "double ..... "; len(testd.struct)
print "finished ..."
For best translation results always follow the advice at Converting C types to LB types.
Happy API coding ;D