64-bit fixes.

Replaced some incorrect long variables/casts to wxIntPtr. On 64-bit wxIntPtr will be a "long long int" causing compile errors.