Page 1 of 1
Posted: Fri Oct 11, 2002 8:25 pm
by BackupUser
Restored from previous forum. Originally posted by VPureBasic.
Hi Fred,
I do not know if I find a BUG or not! Because I tried to make a ProcedureDLL with a FLOAT return value and it did not work... I received a long value... then, I would like to know if it will be possible to make it happens?
Ex:
ProcedureDLL AttachProcess( Instance )
...
EndProcedure
ProcedureDLL DetachProcess( Instance )
...
EndProcedure
ProcedureDLL.f ReturnFloatValue()
ProcedureReturn 100.0
EndProcedure
This example return a long value instead of 100.0...
Thx in advance.
Roger Beausoleil
Posted: Fri Oct 11, 2002 9:06 pm
by BackupUser
Restored from previous forum. Originally posted by Danilo.
HOW does it return it, VPureBasic ??
You should not check the DLL code, but
the code that calls the DLL.
If you use Purebasic as a caller for the
DLL, you can only get Longs as result.
Code: Select all
x = CallFunction(...)
result.f = PeekF(@x)
This should do the trick...
cya,
...Danilo
(registered PureBasic user)
Posted: Fri Oct 11, 2002 9:50 pm
by BackupUser
Restored from previous forum. Originally posted by VPureBasic.
x = CallFunction(...)
result.f = PeekF(@x)[/code]
...Danilo
I Tried this
Answer.f = CallFunction(...)
and the result was wrong...
but I am gona try your way and
come back.
Roger
Posted: Fri Oct 11, 2002 10:24 pm
by BackupUser
Restored from previous forum. Originally posted by Paul.
Search the forum and you will see why you must do it the way Danilo says.
viewtopic.php?t=1097">http://forums.pur ... php?t=1097
----------
Visit the PB Resources Site at
Posted: Sat Oct 12, 2002 2:49 am
by BackupUser
Restored from previous forum. Originally posted by VPureBasic.
Originally posted by Paul
Search the forum and you will see why you must do it the way Danilo says.
Hum, may be I've spoken a little bit faster . I will take a look.
Ok, here is the explaination:
It can't be fixed for now, CallFunction() is a purelibrary and I've fixed the parameter to #Long so the floats are automatically transformed to long.
Yhe PeekL() solution is the way to go for now. I will add an #Any paramater to allow every types in the next version..
Thanks for this report !
Edited by - fred on 09 April 2002 18:21:32
As you can read by yourself, Fred wrote in April that it was a further update... but nerver did. I only want to know by Fred if he change is mind, forget or will have the chance to see it in the futur.
Thx to all... I will use the other way for now...
Roger