AutoHotkey Community

It is currently May 27th, 2012, 12:25 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 24 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: February 6th, 2009, 5:03 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
I think AHK puts .dll automatically so it works in freakks case (i tested his code it works here too)


BTW, think about calling functions vai adress (using statics that will keep adress once it is determined) instead via name. It will be a LOT faster.
Also, you should drop sl in front of fun names and dont' brak dll on several lines. I hardly manage in your code (subjetional oofc)

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2009, 5:45 pm 
Offline

Joined: November 24th, 2007, 9:07 pm
Posts: 774
The return value of the Init function depends on the information you provide. If you provide a _DllDir parameter, the script will return the full Dll path. If you don't, the script will return %A_WorkingDir%\bin\SQLitening.dll (if the file exists).

Either way it should be returning a full Dll path without the Dll extension, which is acceptable per DllCall documentation.

The SVN version is newer than the version in this post, but neither of them actually work in any of my tests so far.

The actual Dll functions are prepended with "sl", so I tried to keep that naming scheme with my functions, since it's pretty much a direct wrapper.

As soon as I can get the functions working, assuming I'm able to, I will rewrite them to be much better. I'll look into calling the functions via address for the next version as well.


Currently, there are no problems connecting to the Dll or calling the functions, but just getting them to actually work. If I can overcome that hurdle, then I will feel secure about making this library more mature. Until I can figure out how to get it working at all, however, I don't see much of a point in a rewrite.

_________________
Ben

My Trac projects
My Wiki
[Broken] - My music


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2009, 7:02 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Ok, you have a point in your arguments.

I downloaded from Subversion.

Your version didn't work, and simple one of freakkk did work.

I didn't have much time to work on it, nor I will have time in next 2 weeks.

I suggest you creating simple developing test file for cases that trouble you. I was aranging your code like 20 minutes to get into what I wanted to tweak around. So, this troubleshooting file should contain as little as possible code that affects actuall thing you want to solve (like user message boxes, if branches with options all relying on similar or the same thing etc..). That way errors can be solved much faster.

For start, it would be good if you can create simple test file that creates database, inserts 1 table in it with 1 row, then queries that table. Append to that functoins needeed stripped of unnecearry details as much as possible (for instance single dll call would sufice with eventual maintance)

I would rly like to see this library alive and Ill try to help you in it as my time allows.

One thing I saw is that you initialise in each function which is 1 extra call without need for it. Either make init mandatory, or put Init in functions that will certanly be called by the user code (for instance they must call Open in all cases, this is good place to put Init and skip it in all other functions which can't be called without previous call to some other API func).

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 6th, 2009, 7:50 pm 
I tested a bit more, but I can't figure out why it doesn't work.
The thing appears to work if file exists. If you omit in "C" in simple freakkk's code, you will get the same message. This means that dll understands input yet, somehow nothing happens after that point.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 7th, 2009, 1:54 am 
Offline

Joined: November 24th, 2007, 9:07 pm
Posts: 774
Agreed, that seems to be the problem.

I appreciate your assistance, I would love to see this project through to completion.

I'll work on a code cleanup so that it's easier for others to look at and contribute to my code. I'll also make a clearer test file to go with it.

The current test file is a rewrite of an example database written in PowerBasic that I made in AHK using my wrapper. Of course, it doesn't work though :)

I call Init in every function, but the function holds a static variable so that it doesn't actually re-initialize every time, but rather just returns the full DLL path that was used to initialize (so that the user doesn't have to call it in every function). Do you think there's a better way I should do that? Is the overhead of an extra function call, even if it just returns static variables, noticeable?

_________________
Ben

My Trac projects
My Wiki
[Broken] - My music


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 7th, 2009, 12:20 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Quote:
Is the overhead of an extra function call, even if it just returns static variables, noticeable?

If you plan to use row insertrion in a for loop, 1 function call (the good thing function doesn't have parameters) is not trivial. The same goes for dll adress intead dll call with dllname. Its not something needed or each and every API, but you should see which of them could be used in a loops and make them as fast as possible.

But that is trivial comparing to current problem. I just wanted to suggest to take some working library from AU3 or PowerBasic to see if you can figure out something, but you already did it.

I will have to try this in C with the same code and see whats wrong. But I am on trip next 2 weeks.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 14th, 2009, 1:57 pm 
The example script generates an error with the latest SQLitening libs.

Quote:
---------------------------
Database creation failed
---------------------------
Database creation supposedly succeeded but no database was created.
---------------------------
OK
---------------------------


:?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 13th, 2009, 8:28 am 
Offline

Joined: January 12th, 2007, 4:30 am
Posts: 531
Location: Norway
bmcclure: Have you made any progress on this since your last post? Is part of your wrapper already functional or not? I just wanted to let you know that I'll be watching this thread. I'm currently trying to implement SQLite on a shared folder but I've had some concerns as discussed here, which I think AHKLitening would solve.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 13th, 2009, 10:37 pm 
Offline

Joined: November 24th, 2007, 9:07 pm
Posts: 774
A small part of the wrapper works, but it is fundamentally broken, and I could not figure out why.

My two largest projects I was planning to use this for were FOMS and SteamLab, however both projects are now primarily written in C# (whish has great DataSource support) instead of AHK and my other projects don't currently need SQL support.

I am currently at a stand-still figuring out what to do to make this work, so I ended up suspending development (maybe indefinitely). Anyone is welcome to pick up AHKL from me and continue development. The project currently has a SVN repository, Trac site, and Wiki section on SingularityShift.com and I will happily leave them available for anyone willing to take this on. I will also gladly provide support and coding help where needed.

If anyone can figure out how to make the base functionality work, I would be willing to pick this project up again and see it to completion. Until then, however, I feel I've spent more than enough time searching for solutions and troubleshooting the code, and it just seems to not work.

_________________
Ben

My Trac projects
My Wiki
[Broken] - My music


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Bon, Google [Bot], SKAN, Yahoo [Bot] and 5 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group