INT64 (or double)
Posted: Tue Aug 03, 2004 11:36 pm
Problem : the opentrace API function return a tracehandle which is an INT64 (not its adress). How can I do to get the value returned with PB?
Thanks in advance.
Thanks in advance.
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
Structure dblout
p1.l
p2.l
EndStructure
Procedure.f Float(p1.l,p2.l)
Global _output.f
Global _dblin.dblout
_dblin\p1=p1
_dblin\p2=p2
!FLD qword[v__dblin]
!FST dword[v__output]
ProcedureReturn _output
EndProcedureCode: Select all
Structure iSQPDouble
Hi.l
Lo.l
EndStructure
Procedure MakeiSQPDouble(LONG.f, ADDRESS.l)
!FLD dword [ Esp ]
!MOV dword Eax, [ Esp + 4 ]
!FSTP qword [ Eax ]
EndProcedure
; here is an example return
Procedure.l iSEDDrawImage(Left.f, Top.f, Width.f, Height.f)
dLeft.iSQPDouble
dTop.iSQPDouble
dWidth.iSQPDouble
dHeight.iSQPDouble
MakeiSQPDouble(Left.f, @dLeft)
MakeiSQPDouble(Top.f, @dTop)
MakeiSQPDouble(Width.f, @dWidth)
MakeiSQPDouble(Height.f, @dHeight)
ProcedureReturn CallFunctionFast(FPDrawImage, dLeft\Hi, dLeft\Lo, dTop\Hi, dTop\Lo, dWidth\Hi, dWidth\Lo, dHeight\Hi, dHeight\Lo)
EndProcedureYeah, I have no idea..tonnelier wrote:eventually, this type of thing work :
a.large_integer
a\lowpart=callfunction(...)
I think PB gives to the DLL the adress of the variable to fill in.
And for a DLL that requires only one variable a, which is a large_integer, it appears that callfunction(0,"function",a\lowpart,a\highpart) works.