External Functions Cannot Use Objects as Parameters
From Xojo Documentation
Error message
This error occurs if you Declare an external function and try to specify that one of its parameters is an object.
When passing a MemoryBlock to a Declare, use Ptr instead. When passing a window to a Declare, use WindowPtr instead.
See Also
Declare statement; MemoryBlock class.