managed app compiled with $set noilnative
declare myhandle as binary-long = self::Handle as binary-long
declare myret as binary-long
call "subprog" using myhandle myret
native subprog.
working-storage section.
01 pp procedure-pointer.
linkage section.
01 winhandle pic x(4) comp-5.
01 retlength pic x(4) comp-5.
procedure division using winhandle retlength.
set pp to entry "User32"
call winapi "GetWindowTextLengthA"
using by value winhandle
returning retlength