Page 1 of 1

Calling C DLL

Posted: Wed Mar 24, 2004 4:47 pm
by thomasrueger
Hello, just one question from a Newbie:

I have a C DLL from a databaseserver ... With VB i could use it directly with ADO.

So i tried it with purebasic and i think there is something wrong.

I tried also with the purebasic DLL Importer, but it always stop working, so i wanna make it directly.

Here is the first function from the header file:

ISC_Status isc_Export isc_embed_dsql_release(ISC_Status ISC_FAR *, char ISC_FAR*)

i found also, that in the header ISC_STATUS is define as long, ISC_Export is define in a few ways, f.e. -stdcall and ISC_FAR has a define as _far.

So i translated it like follow:

long _stdcall ...(long _far *, char _far *)

i made in purebasic a few pointers and called the procedure, but nothing could help.

Can somebody help my by translation the header in purebasic ?

If you want the hole header file you will find it every where in the internet. Its a databaseserver "Firebird" , f.e. in sourceforge.net.

i want to make a little wrapper for use this Firebird Database Server for PureBasic, but i am not a C Programmer and i have now Problems by translating it ...

Thanks a lot

Cu Thomas

Re: Calling C DLL

Posted: Wed Mar 24, 2004 8:33 pm
by AlGonzalez
thomasrueger wrote:Hello, just one question from a Newbie:

I have a C DLL from a databaseserver ... With VB i could use it directly with ADO.
I'm not sure what you mean by using it directly with ADO since ADO uses COM automation and so you weren't calling the 'C' dll directly.

If you mean that ADO could be used to connect to the database, then ADO is probably talking to a driver, either ODBC or OLEDB, the supports the FireBird database.

You should be able to use the ODBC support provided by PureBasic to connect to the database.

HTH

Posted: Fri Mar 26, 2004 1:59 pm
by thomasrueger
Hello AlGonzalez,

you are right..

PureBasic and ODBC and a suitable driver is working.

but i don't want to use odbc.

the dll (fbclient.dll) from firebird i a C DLL. So PureBasic seemed to have everything for directly call.

Results?

Posted: Fri Jul 22, 2005 11:36 pm
by Omnius
What did you end up doing here? I'm trying to do this myself now.