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 / Importing functions that return floats

Author
Message
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 12th Jan 2011 18:44
Hi, do I have to do anything different when importing a function that returns a float?

Here is what I have:


I am having problems and the main suspects are these commands, I know returning a float for an exported function is a special case so I wondered if it could cause an issue here.

Thanks.

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 12th Jan 2011 19:29
The function should return a DWORD, not a float. Then you can cast it to a float like this:


[b]
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 12th Jan 2011 19:44 Edited at: 12th Jan 2011 20:01
Thanks Diggsey, I will try that.
I have actually seen that before but was getting a little confused I think

EDIT: Worked perfectly, can't thank you enough.

Login to post a reply

Server time is: 2024-11-23 10:12:14
Your offset time is: 2024-11-23 10:12:14