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.

DarkBASIC Professional Discussion / Problems with DLL return value

Author
Message
Morcilla
23
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 18th May 2003 22:49
Hi there,
I'm writing a custom DLL that returns a calculated value.

There is no problem with integers, I pass two operands to the DLL and it returns a correct value (integer).

The problem comes if I use float or double:

If I pass two float variables, both arrive ok to the DLL, but the return value (float) is incorrect.

If I pass two double variables, the second operand does not seem to arrive to the DLL (first operand arrives ok). The returned value (double) is not correct.

Has anyone experienced this?
Thanks in advance!
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 18th May 2003 22:57
With returning of floats, its not as simple as it should/could be - read the technical documents to see how to get around it.
As for two doubles - can't say I have had the problem - have you got the string table correct ?

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Morcilla
23
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 18th May 2003 23:10
Well I then got default string table when creating ATL DLL, in other DLL types I do not use it.

I'm looking at the doc now, thanks.
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 18th May 2003 23:13
No ATL DLL's can be used either.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th May 2003 01:11
Are you using C or C++? In that case, try using this function to return your value



You would use it like this:

Morcilla
23
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 19th May 2003 13:36
Well, I'm using VC++. After populating the string table correctly, it seems to work much better.
No problems with double values.
Thanks anyway IanM, that could be useful.

Login to post a reply

Server time is: 2026-07-11 19:05:07
Your offset time is: 2026-07-11 19:05:07