I have the same problem.
I have a lot of problems with COM objects since a few functions (for example "Handle(xxx)" and the "other" event) returns longptr in real life eventhou they are specified in the documentations as long.
Casting to long solves most problems like changing "Handle(this)" to "long(Handle(this))".
I have search the code for loading the Crystal Runtime for this incompability but not seen something so far. I am almost guessing that the COM implementation inside PowerBuilder is missing a cast somewhere. They have also missed this in the "Mod(xxx, yyy)" function.
We only run 32bit system but are compiling using a 64-bit OS.
Regards
Aldus