This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- calling dll sqlite
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 11, 2009
05:13 AM
calling dll sqlite
Hello people, I'm trying to desing BasicMSI with an Installscript custom action for create an easy DDBB with sqlite3.dll
I'm following some examples in this forum, but the call to the function allways FAIL, and I don't know why.
I'm not a programmer and this script is the first call that I desing to a C++ dll ... I'm not sure what type of parameter is "sqlite3 **ppDb" and how to retrieve it.
Can anyone give a clue? what I'm doing wrong?
thanks for your time.
(sorry for the duplicate post, but no answers in the original thread, if there is more lucky here....)
I'm following some examples in this forum, but the call to the function allways FAIL, and I don't know why.
prototype cdecl INT sqlite3.sqlite3_open(STRING,POINTER);
#include "Ifx.h"
export prototype FINAL(HWND);
function FINAL(hMSI)
POINTER nResult;
STRING ERROR1,ERROR;
INT bResult;
begin
bResult = UseDLL ( "sqlite3.dll" ); // (load is OK)
bResult = sqlite3_open("ABCDE",nResult);
UnUseDLL("sqlite3.dll");
end;
I'm not a programmer and this script is the first call that I desing to a C++ dll ... I'm not sure what type of parameter is "sqlite3 **ppDb" and how to retrieve it.
Can anyone give a clue? what I'm doing wrong?
thanks for your time.
(sorry for the duplicate post, but no answers in the original thread, if there is more lucky here....)
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 11, 2009
11:29 AM
Generally this kind of argument (a pointer to a pointer) is used for returning a pointer to the caller. You might try declaring the argument as BYREF POINTER instead of just POINTER, or passing &nResult instead of nResult. Programming without learning how is going to be difficult, though, and cross-language interfacing is not a very easy topic to start with. 🙂
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 16, 2009
06:41 AM
yes the change to BYREF POINTER was the answer. A lot of thanks
was not as complicated 😉
prototype cdecl INT sqlite3.sqlite3_open(STRING,BYREF POINTER);
prototype cdecl INT sqlite3.sqlite3_exec(POINTER,STRING);
prototype cdecl INT sqlite3.sqlite3_close(POINTER);
POINTER ppDb;
INT nResult,BufferSize;
STRING string1,string2;
begin
UseDLL("sqlite3.dll");
nResult = sqlite3_open(CommonAppDataFolder^"Digital.sqlite",ppDb);
BufferSize = 500;
nResult = MsiGetProperty(ISMSI_HANDLE,"PROPERTY1",string1,BufferSize);BufferSize = 500;
nResult = MsiGetProperty ...............
...
...
...
Command = "CREATE TABLE abc (ID Text PRIMARY KEY ......)";
nResult = sqlite3_exec(ppDb,Command);
Command = "INSERT INTO abc (colum1,colum2) VALUES ('"+string1+"','"+string2 +"')";
nResult = sqlite3_exec(ppDb,Command);
nResult = sqlite3_close(ppDb);
UnUseDLL("sqlite3.dll");
end;
was not as complicated 😉