Ouch! Review the documentation, the parameters list for CreateThread() and beginthreadex() are not the same!

As for the CreateThread() business, it is certainly true in the past that CreateThread() could create memory leaks if used with certain other routines in the standard library.

A recent inspection of the headers leads me to suspect that this may no longer be the case, that said, I use beginthread() or beginthreadex() all the time because I am used to doing so. I don't know anybody who uses CreateThread() professionally, people are wary of it, but probably for irrational reasons.