Deprecated: Array and string offset access syntax with curly braces is deprecated in /homepages/21/d38531796/htdocs/jose/smfforum/Sources/Subs.php on line 3825 Print Page - Using a Purebasic DLL from Powerbasic - Return LONG Values BYREF
Theo's Forum
Purebasic-Tipps and Code => Purebasic Tipps => Topic started by: Theo Gottwald on March 09, 2022, 06:13:08 PM
Title: Using a Purebasic DLL from Powerbasic - Return LONG Values BYREF
Post by: Theo Gottwald on March 09, 2022, 06:13:08 PM
In this case we want to return 3 Values "byref" from the Purebasic-32 but written DLL. On the Purebasic Side it looks like this:
' Sample calling a Purebasic DLL from Powerbasic, returning 4 LONG Values "BYREF"
DECLARE FUNCTION Read_Joystick LIB "XYZ.DLL" ALIAS "Read_Joystick" (BYVAL No AS LONG,BYVAL Pad AS LONG,BYVAL MODE AS BYTE,BYREF x AS LONG,BYREF y AS LONG,BYREF z AS LONG) AS LONG
On the PowerBasic Side we can call directly this function with variables to get the X,Y and Z-Values of the Joystick with that number.