For some reason the PXC3DScan scan object, runs successfully only inside a windows thread.
// This does not work:
//This does work:
int data = 0;
HANDLE h = CreateThread(0, 0, do_real_sense, NULL, 0, 0);
Array_Of_Thread_Handles = h;
WaitForMultipleObjects(1, Array_Of_Thread_Handles, TRUE, INFINITE);
This has to be a windows thread, standard C++ threads don't work. In addition the scan quality in C++ is not as good as the C# code (identical pieces of code). Any one has an idea why?
For more complete information about compiler optimizations, see our Optimization Notice.