Using External DLL

Posted By: ATOMIX

Using External DLL - 07/31/08 17:06

Can we load external dll's in lite-c? I really need to be able to load the sqlite3.dll and use it for database access. But I am at a loss on how to load an external dll into our lite-c code. I have a lot of experience in C/C++ programming but am at a loss about how to include the .h file and then compile to access the external dll. I am confused at the difference between pure C mode and lite-c mode and can I combine them? Help!!!!!! I can't find any code examples in the documentation. We need a lite-c reference guide very badly.
Posted By: NITRO777

Re: Using External DLL - 08/05/08 00:34

Hi,
Download this aum magazine and tell me if it helps clear up things for you:

AUM 31

There is an article in there which deals with the SDK
Posted By: Quad

Re: Using External DLL - 08/05/08 01:48

see the manual(gamestudio sdk part),

setup your ide(preferably vc++ 2008 express), add lib and include dir(gstudio7/sdk_plugin) and compile it.


i can provide you a little example i started(but have no time to contunie) that uses sqlite3 amalgamation(or something like that), and lets you use opendb and exec commands(yea, really works) in lite-c. If you are experienced in c++ this will get you started i think.


(ps. you can write wrappers for dlls to use them with lite-c. like load the dll in litec and write another one with DLLFUNC s inside to use that external dll.)
Posted By: ATOMIX

Re: Using External DLL - 08/05/08 16:46

Quadraxas:
An example would be awesome. I am having the most problem with the sqlite3.h file, it keeps getting stuck on the #if statements (that happens with all windows sdk headers I have used), I am stuck on the sqlite3 structure that is returned from the sqlite3_open() database function and am just stuck with it. Can't even get the header files to load.

TriNitroToluene:
Thanks for the reply. I read the magazine but it was c-script not lite-c. As a newbie all of these scripting languages are confusing and require way too much of a learning curve just trying to figure out which one to use!!
Posted By: Quad

Re: Using External DLL - 08/05/08 19:04

here you go:
example archieve
i included a readme file for explanation and commented the code files.
Posted By: ATOMIX

Re: Using External DLL - 08/11/08 16:32

Quadraxas: I am forever in your debt. You just saved my butt from sitting in this chair for a long, long time trying to make this work. I tried your test and the databases opened in sqlite Admin perfectly. I will now attempt to put the code into my code and try the test on our sqlite database. I will tear your code apart and try the same thing on OpenAL which is an extremely powerful open source Audio library. I want to be able to really stream audio from the internet. We have our own Audio stream set up at http://www.atomixworld.com:8000/Streaming.ogg/ into your player, this stream uses iceCast2 with an mp3 encoder and we setup an internet radio station at http://www.takilmafm.com yea we actually pay royalties and all for this one. We have an average of 16,000 listening. This was our first attempt at streaming and it uses Windows encoders. We plan on updating this to iceCast2 soon. Once again we at Atomix Group LLC in Eugene, Oregon USA, are totally in your debt. If you ever need anything we can provide, please don't hesitate to ask.

Note: I will work solid on the statement code for this lib and send it back to you. I spent a couple of hours studying the statement method and feel I have a handle on it. I needed to study statements anyway and have been putting it off. You gave me the core of everything I need to finish it.
© 2023 lite-C Forums