Calling sqlite3_create_module from a DLL

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Calling sqlite3_create_module from a DLL

deon
I have a DLL that makes a series of sqlite3_create_function_v2 calls. It all works fine and the DLL is usable.

I've tried adding a sqlite3_create_module into the same DLL, but I get an assert in:

sqlite3_mutex_try
over here:
    assert( sqlite3GlobalConfig.mutex.xMutexTry );

xMutexTry (really all the .mutex callbacks) are null.

I'm trying to call create_module during my sqlite3_extension_init export, directly after my call to SQLITE_EXTENSION_INIT2(pApi);


The same sqlite3_create_module statement works fine if I add it to my .exe (where I'm the one initializing SQLITE) instead of my .dll. Is there anything I need to do extra during initialization to get sqlite3_create_module to work?

- Deon

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Calling sqlite3_create_module from a DLL

Clemens Ladisch
Deon Brewis wrote:

> I have a DLL that makes a series of sqlite3_create_function_v2 calls.
> It all works fine and the DLL is usable.
>
> I've tried adding a sqlite3_create_module into the same DLL, but I get
> an assert in:
>
> sqlite3_mutex_try
> over here:
>     assert( sqlite3GlobalConfig.mutex.xMutexTry );
>
> xMutexTry (really all the .mutex callbacks) are null.
>
> I'm trying to call create_module during my sqlite3_extension_init
> export, directly after my call to SQLITE_EXTENSION_INIT2(pApi);

Apparently, you did not call sqlite3_initialize().
<https://www.sqlite.org/c3ref/initialize.html> says:
| For maximum portability, it is recommended that applications always
| invoke sqlite3_initialize() directly prior to using any other SQLite
| interface.


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users