It's been quite a long while since I used vb6 on a regular basis; however, integrating with native DLLs can be quite tricky for several reasons:
1. It cannot call any native function that does not conform to the "stdcall" calling convention. 2. It has a very Win32-centric way of marshalling data types. 3. Using 64-bit integers at all is somewhat tricky, IIRC. You may need to use a ByVal structure to pass them and I cannot remember how to use them as returned values. 4. Properly declaring and calling (e.g. using the ByVal keyword strategically) is critically important. Another issue is ANSI versus Unicode (UCS2 for COM) versus UTF-8 (SQLite) and knowing when to use which and how to convert between them (or marshal them). 5. Doing inbound callbacks to VB6 code is very very tricky, mostly due to [apartment] threading issues. I think that using the AddressOf keyword won't really work with SQLite in this context due to mismatched calling conventions (cdecl versus stdcall). I'll try looking for my old VB6 SQLite integration code when I have some spare cycles. Sent from my iPhone > On Dec 24, 2015, at 11:10 AM, Bart Smissaert <bart.smissaert at gmail.com> > wrote: > > OK, thanks > I don't use any of 1 to 3, I only use the standard SQLite functions such as > sqlite3_open_v2, sqlite3_prepare16_v2, sqlite3_step, sqlite3_bind, > sqlite3_column, sqlite3_create_function_v2, sqlite3_finalize, > sqlite3_reset, sqlite3_result, sqlite3_value and qlite3_close. > So, in that case I don't need sqlite3_free, sqlite3_malloc or > sqlite3_realloc, I take it. > Given that I don't use theses it then likely that my problem is to do with > a buffer overwrite? > > RBS > > > >> On Thu, Dec 24, 2015 at 8:35 PM, Richard Hipp <drh at sqlite.org> wrote: >> >>> On 12/24/15, Bart Smissaert <bart.smissaert at gmail.com> wrote: >>> My question is if there is ever any need in this situation to run one of >>> the sqlite3 memory procedures, that is >>> sqlite3_free, sqlite3_malloc or sqlite3_realloc? >>> Currently I am not using this anywhere in my VB6 code. >>> Should I? >> >> Cases when you might use sqlite3_malloc(): >> >> (1) You are using on of SQLite's built-in memory allocators. The >> built-in memory allocators are disabled unless you use certain >> compile-time options. And even then, you have to turn them on using >> sqlite3_config(SQLITE_CONFIG_HEAP,...). >> >> (2) You need to use sqlite3_msize(). >> >> (3) If you use sqlite3_mprintf(), then sqlite3_free() must be used to >> release the string once you are done with it. >> >> Otherwise, there is no real advantage to using SQLite memory allocator >> interface in place of your standards system memory allocator. >> >> -- >> D. Richard Hipp >> drh at sqlite.org >> _______________________________________________ >> sqlite-users mailing list >> sqlite-users at mailinglists.sqlite.org >> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ > sqlite-users mailing list > sqlite-users at mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users >