--- Dennis Cote <[EMAIL PROTECTED]> wrote: > Jay Sprenkle wrote: > > >>[2] Looking at the sqlite3_bind_* APIs, I'm curious > about > >>the destructor functions, and the "special values", > >>SQLITE_STATIC, and SQLITE_TRANSIENT. Not being a C > >>programmer, these constants are a mystery to me. I > think > >>it'd be useful to use the sqlite3_bind_* APIs, but I > don't > >>have any clue what to do about the destructors. My > >>inclination is to use one of the special values, but I > >>don't think WinBatch is gonna understand. Wouldn't > these > >>just compile down to integers 0, or -1? Could I just > pass > >>them to the APIs as integers? > >> > >> > > > >These are defined using "#define". This is a text > substitution at compile > >time. If you look you'll see it's substituting integer > numbers for those > >name strings. It's done to make the code more readable. > Passing the > >appropriate integer value (taken from the #define) will > work just fine. > > > > > > > I will usually work just fine, but may fail for the same > reasons Henry > discussed about the sqlite structure handle. The > destructor argument to > the sqlite_bind calls are actually pointers, in this case > pointers to > functions. The special case values are replaced by the C > preprocessor > with expressions that cast the integer constants 0 and -1 > to the > required function pointer type. To call these APIs on a > machine with 64 > bit pointers and 32 bit integers you have the same issues > as with the > sqlite3 handle. You need to ensure that you pass a 64 bit > pointer to > these routines, passing integer values may not work. > > Dennis Cote >
OK, good information from all. Thanks very much. It's helped me move on with the project. Obviously, this wrapper will be limited to 32 bit systems until WinBatch adds a function to read the 64 bit pointer from the buffer. Currently it maxes-out with a 32 bit read. I'll ask them about that. Short-term, I think I should be OK :-) -Clark