Failure #0 is, apparently, "usually the result of calling a function declared with one calling convention with a function pointer declared with a different calling convention".
"Usually"? Does anyone have any idea what else may cause this "unusally"?
When I run my Windows console app in debug mode it always breaks at the same point - at the closing brace of this function:
void threadDelay(int nTicks)
{
Sleep((DWORD)(nTicks * TIME_PER_TICK));
}
So I'm not sure if this is pointing at Sleep() or threadDelay() as the offending function, assuming the failure is a result of the "usual" reason.
threadDelay() is called, eventually, from a function run as a thread started by beginthreadex() which is therefore declared as _stdcall. I have assumed, perhaps wrongly, that the _stdcall requirement of functions started by beginthreadex() doesn't have to be rippled down into any function they call.
The app is compiled with /Gd (_cdecl) for x86 using the multi-threaded DLL run-time libraries. It comprises a number of static libraries and DLLs.