>Thank you very much. That did the trick. I am seeing a 33% improvement using the C++ routine over VFP (the job used to take 120 hours to run). I am planning to move the big array completely to C++ and bypass all of the _HLock, _Load, _HandToPtr, _HUnLock, _FreeHand overhead.
You are welcome :)
That's right, using C++ routine (plus VFP API) can improve VFP performance a lot.
Good luck and happy C++ coding :-D
Herman