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
ProcedureDLL ReturnValue Type
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
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.
This should do the trick...
cya,
...Danilo
(registered PureBasic user)
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)
cya,
...Danilo
(registered PureBasic user)
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
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
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
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by VPureBasic.
Thx to all... I will use the other way for now...
Roger
Originally posted by Paul
Search the forum and you will see why you must do it the way Danilo says.
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.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
Thx to all... I will use the other way for now...
Roger