Sorry I forgot to mention: I already tried single C function. I even tried with extern "C" just in case but got exactly the same result.
I also tried __stdcall and __cdecl but looks like SQLite is wayting for __fastcall function pointer On Wed, Dec 17, 2008 at 5:37 PM, Martin Engelschalk <engelsch...@codeswift.com> wrote: > Hi, > > i suspect that you problem is the class MyClass. > Try to define your function "ScorePosition" as a C-function outside of a > class. > > Martin > > Guillaume Schub wrote: >> Hi everyone, >> >> I have spent nearly one day on this already with no success. I am >> currently trying to create some custom function on a SQLite3 database. >> >> What I did (just to test): >> >> sqlite3_create_function(m_pDB, "ScorePosition", "ScorePosition", 8, >> SQLITE_ANY, NULL, &ScorePosition, NULL, NULL); >> >> class MyClass >> { >> ... >> static void ScorePosition(sqlite3_context *pContext,int argc, >> sqlite3_value** argv); >> ... >> }; >> >> void MyClass::ScorePosition(sqlite3_context *pContext,int argc, >> sqlite3_value** argv) >> { >> ... >> } >> >> SELECT ScorePosition(1, 2, 3, 4, 5, 6, 7, 8) FROM MyTable; >> >> No the problem is that the callback is called, but pContext is always >> NULL, argc a fancy value, and argv always the same value (like >> 0x0012f2d4) >> >> What am I missing here ? >> >> Guishu >> _______________________________________________ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> >> > > -- > > * Codeswift GmbH * > Traunstr. 30 > A-5026 Salzburg-Aigen > Tel: +49 (0) 8662 / 494330 > Mob: +49 (0) 171 / 4487687 > Fax: +49 (0) 12120 / 204645 > engelsch...@codeswift.com > www.codeswift.com / www.swiftcash.at > > Codeswift Professional IT Services GmbH > Firmenbuch-Nr. FN 202820s > UID-Nr. ATU 50576309 > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users