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 / How to return Floats and Doubles from Delphi?

Author
Message
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 18th Sep 2005 21:06
I have read in the DBPro help files that in C++, floats are returned differently to DBPro from a dll. Like this...



How would I return a float or a double properly in Delphi? At the moment singles don't transfer at all properly, and if I try and return a double, although it returns correctly, I get odd, blank error messages and sometimes complete freeze ups, depending on the number of times I called the command.

Cheers in advance!

empty
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 18th Sep 2005 21:27
To return a single type value:



Play Nice! Play Basic! Version 1.088
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 19th Sep 2005 18:10 Edited at: 19th Sep 2005 18:18
Cheers Empty . I think the crashes were due to the lack of "cdecl;" on my functions, so I'm guessing doubles are returned the regular way. Thanks!

EDIT

And while your at it, if you have any code demonstrating the method of returning strings, then it'd be really appreciated (so far you seem to have told me everything I know about Delphi DLLs).

Login to post a reply

Server time is: 2024-05-06 07:45:28
Your offset time is: 2024-05-06 07:45:28