Re: I give up...
Posted by Chris Uppal-3 on May 21, 2004; 9:33am
URL: https://forum.world.st/I-give-up-tp3370619p3370622.html
Sean Malloy wrote:
> So I get callback version working. But I get these exceptions occurring.
>
> a GPFault('Invalid access to memory location. Reading 0x68, IP 0x673E691F
> (C:\Documents and Settings\Sean\My Documents\Dolphin Smalltalk 5.1\Sean
> Malloy\SQLITE.dll)')
I think it's because the sqlite library is using the 'cdecl' calling
convention, rather than 'stdcall' (not that they bother to /tell/ you that
anywhere, not even in the source -- it must be a flag to the compiler). If you
change SqliteLibrary>>resultForQuery:on:do: to read:
===================
resultForQuery: aString on: sqliteRef do: operation
| descriptor callback error |
descriptor := ExternalDescriptor fromString: 'cdecl: sdword void* dword char**
char**'.
callback := ExternalCallback
block: [ :a1 :a2 :a3 :a4 | operation value: a2 value: a3 value: a4. 0]
descriptor: descriptor.
error := ExternalAddress new.
self apiExec: sqliteRef sql: aString callback: callback asParameter with: nil
error: error.
self checkError: error.
===================
then you should be able to move on to the next stage of trying to make sense of
the LPVOIDs (which /always/ confuse me).
-- chris