Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / Returning a value from a dll

Author
Message
dance dreemer
21
Years of Service
User Offline
Joined: 24th Jan 2003
Location: cyber space
Posted: 5th Mar 2007 16:55
Hi i recently bought a usb project board from velleman electronics which came with all the drivers and a dll file containing all the functions to work the project board and a pdf explaining what thay do with examples in delphi, c+ and vb. I managed to load the dll into db and got it to work ok but some of the functions in the dll return a value so i looked in the db manual and found none of the 5 commands db has native return a value from a dll function.. for example it says in the pdf:

var h: longint;
BEGIN
h:=OpenDevice(0); // Opens the link to card number 0
END;

so by rights that should return the value of the card number to h
so what im trying to do is do the same in db but cant seem to figure out how.. i have tryed using things like :

a = call dll 1,"OpenDevice",0
print a

but db errors on that so since (as far as i know) theres no db command to return a value how would i go about doing it ?

any help would be great ..
thanx in advance..

dancedreemer

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 5th Mar 2007 18:43
You forgot brackets - this:

a = call dll 1,"OpenDevice",0

should be this:

a = call dll(1,"OpenDevice",0)

dance dreemer
21
Years of Service
User Offline
Joined: 24th Jan 2003
Location: cyber space
Posted: 5th Mar 2007 21:06
ohh thanx ill try that

dance dreemer
21
Years of Service
User Offline
Joined: 24th Jan 2003
Location: cyber space
Posted: 5th Mar 2007 21:09
thanx ianm worked like a charm

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Mar 2007 00:01
Glad to help out

Login to post a reply

Server time is: 2024-06-16 06:00:49
Your offset time is: 2024-06-16 06:00:49