[sqlite] Slight problem with sqlite3_compileoption_get

2016-01-25 Thread James K. Lowden
On Sun, 24 Jan 2016 21:26:41 + Bart Smissaert wrote: > http://www.cdecl.org/ > > It doesn't work though with complex arguments like this: > void (*xFunc)(sqlite3_context*,int,sqlite3_value**) In isolation, that's a syntax error because e.g. sqlite3_value is not defined (on that line,

[sqlite] Slight problem with sqlite3_compileoption_get

2016-01-24 Thread Bart Smissaert
> I was very much right! You are, but in my VB6 code the sqlite3* object is always represented as a pointer (Long in VB6), so that pointer will then have to be passed ByVal. > It will if you correct that signature. Ah, OK, thanks. > I strongly recommend doing one of those online courses about C.

[sqlite] Slight problem with sqlite3_compileoption_get

2016-01-24 Thread Bart Smissaert
> If your VB variable contains an sqlite3* then the item should be passed ByVal. Ah, yes, thanks for correcting that. RBS On Sun, Jan 24, 2016 at 10:18 PM, Keith Medcalf wrote: > > > >> I think that unless the argument is going to be altered I have to pass > > them always ByVal. > > That

[sqlite] Slight problem with sqlite3_compileoption_get

2016-01-24 Thread Bart Smissaert
http://www.cdecl.org/ It doesn't work though with complex arguments like this: void (*xFunc)(sqlite3_context*,int,sqlite3_value**) which is an argument of sqlite3_create_function_v2 RBS On Sun, Jan 24, 2016 at 8:12 PM, Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 >

[sqlite] Slight problem with sqlite3_compileoption_get

2016-01-24 Thread Bart Smissaert
>> I think that unless the argument is going to be altered I have to pass them always ByVal. That wasn't quite right, eg: int sqlite3_close(sqlite3*); sqlite3* is not going to be altered, but I can see that this should be passed ByRef > Your rule should be ByVal when there are no '*' and ByRef

[sqlite] Slight problem with sqlite3_compileoption_get

2016-01-24 Thread Keith Medcalf
> http://www.cdecl.org/ > > It doesn't work though with complex arguments like this: > void (*xFunc)(sqlite3_context*,int,sqlite3_value**) > > which is an argument of sqlite3_create_function_v2 > > RBS It does not do anything at all. It is just a static page with an entry box. > > On

[sqlite] Slight problem with sqlite3_compileoption_get

2016-01-24 Thread Keith Medcalf
> >> I think that unless the argument is going to be altered I have to pass > them always ByVal. > That wasn't quite right, eg: > int sqlite3_close(sqlite3*); > sqlite3* is not going to be altered, but I can see that this should be > passed ByRef If your VB variable contains an sqlite3* then the

[sqlite] Slight problem with sqlite3_compileoption_get

2016-01-24 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 24/01/16 13:12, Bart Smissaert wrote: >>> I think that unless the argument is going to be altered I have >>> to pass > them always ByVal. That wasn't quite right, eg: int > sqlite3_close(sqlite3*); sqlite3* is not going to be altered, but I > can

[sqlite] Slight problem with sqlite3_compileoption_get

2016-01-24 Thread da...@andl.org
Subject: Re: [sqlite] Slight problem with sqlite3_compileoption_get > That is where you confused me. C also has a long type! Yes, that is why I said IDL long. > File byte under "lucky" above. OK, I can see that and replaced that with int. What is differ

[sqlite] Slight problem with sqlite3_compileoption_get

2016-01-24 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 24/01/16 02:19, Bart Smissaert wrote: > You didn't mention it but how arguments are called from VB6 is also > very important, that is ByVal or ByRef. I think that unless the > argument is going to be altered I have to pass them always ByVal. Sort

[sqlite] Slight problem with sqlite3_compileoption_get

2016-01-23 Thread R Smith
On 2016/01/23 9:41 PM, Bart Smissaert wrote: > Using a .tlb file to access the sqlite3 functions from VB6. > Sofar when the arguments of the sqlite3 function are declared as int I have > been using > long in the IDL source to compile the tlb and this has been fine. I'm not very familiar with

[sqlite] Slight problem with sqlite3_compileoption_get

2016-01-23 Thread Bart Smissaert
> I am somewhat confused about what you wrote. This has to do with making a .tlb (type library) to access sqlite3.dll from a VB6 ActiveX dll. This type library is made by compiling (with midl) an .idl source file. In this .idl file I need to map the SQLite data types with IDL data types. Sofar I

[sqlite] Slight problem with sqlite3_compileoption_get

2016-01-23 Thread Bart Smissaert
Using a .tlb file to access the sqlite3 functions from VB6. Sofar when the arguments of the sqlite3 function are declared as int I have been using long in the IDL source to compile the tlb and this has been fine. sqlite3_compileoption_get is defined like this: const char

[sqlite] Slight problem with sqlite3_compileoption_get

2016-01-23 Thread Keith Medcalf
> I am somewhat confused about what you wrote. SQLite provides a C > level api. You can ignore the types and put in alternatives. > Depending on byte order, calling conventions, what the C types > actually mapped to, sizes of types etc it may work when wrong anyway, > or you could get seriously

[sqlite] Slight problem with sqlite3_compileoption_get

2016-01-23 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 23/01/16 17:36, Bart Smissaert wrote: > What is different though about sqlite3_compileoption_get, so that > long in the IDL causes the mentioned problems and int doesn't? Absolutely nothing is different about that API. If something was then one

[sqlite] Slight problem with sqlite3_compileoption_get

2016-01-23 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 23/01/16 13:14, Bart Smissaert wrote: >> I am somewhat confused about what you wrote. > > This has to do with making a .tlb (type library) to access > sqlite3.dll from a VB6 ActiveX dll. That much was clear. > Sofar I have mapped SQLite int with

[sqlite] Slight problem with sqlite3_compileoption_get

2016-01-23 Thread Scott Robison
On Sat, Jan 23, 2016 at 2:18 PM, R Smith wrote: > > > On 2016/01/23 9:41 PM, Bart Smissaert wrote: > >> Using a .tlb file to access the sqlite3 functions from VB6. >> Sofar when the arguments of the sqlite3 function are declared as int I >> have >> been using >> long in the IDL source to compile

[sqlite] Slight problem with sqlite3_compileoption_get

2016-01-23 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 23/01/16 11:41, Bart Smissaert wrote: > My question is how could I have foreseen this problem, so how could > I have known that using long is no good here? I am somewhat confused about what you wrote. SQLite provides a C level api. You can