PowerBuilder Declare Local External Functions With Global Function Object
if you need to write a global function that uses the External Functions API you can declare it locally it doesn’t need to use the global. so if you need to export it easily. you don’t have to use userobjects. if using a userobjects you must declare it before use. you need to edit source to add the function to declare the tag “type prototypes”
and “end prototypes”
Example Function
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | type str_point from structure long posx long posy end type global type gf_test from function_object end type type prototypes Function Boolean SetCursorPos(Int cx, Int cy) Library "User32.dll" Function Boolean GetCursorPos(Ref str_point POINT) Library "User32.dll" Alias For "GetCursorPos;Ansi" Subroutine Sleep(Long lMilliSec) Library "Kernel32.dll" end prototypes forward prototypes global subroutine gf_test () end prototypes global subroutine gf_test (); Sleep(5) end subroutine |
Good Luck!