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 / Delphi returning buffer of floats?

Author
Message
TheLion
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 29th Aug 2005 13:56
I'm trying to pass an array of floating point numbers from a DLL written in Delphi back into a memblock in DB pro,anyone know how?

Cheers Leo
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 31st Aug 2005 14:17
Call your delphi function with the address of the memblock, then have delphi write the values there.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
TheLion
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 31st Aug 2005 18:24
Yeah, I'm doing that and it seems to be working..Well something coming back into the memory block?

I'm not too clear on Byte,Word,Dword and Float alignments within
memory blocks (the book seems a little vague!)

Bytes 0,1,2,3.4......
Words 0,2,4,6,8......
Dwords 0,4,8,12,16....
Floats 0,4,8,12,16....

So floating point value number 2 in the memory block is at memory offset 4? Or is it automatically incremented, which is it?

Result#=Memblock Float(1,2) or Result#=Memblock Float(1,4)

I think this might be the reason I'm getting #Nan's returned in the memblock buffer.



Regards Leo
empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 1st Sep 2005 17:15
Quote: "So floating point value number 2 in the memory block is at memory offset 4? (Result#=Memblock Float(1,4))"

Yes.


Play Nice! Play Basic! Version 1.088

Login to post a reply

Server time is: 2024-11-21 18:19:55
Your offset time is: 2024-11-21 18:19:55