It's just a race condition issue.
If the code is interleaved like this:
thread 1: trc.str(std::wstring());
thread 2: trc.str(std::wstring());
thread 1: trc<<x;
thread 1: OutputDebugString(trc.str().c_str());
thread 2: trc<<x;
thread 2: OutputDebugString(trc.str().c_str());
the output seems printed twice but it isn't. It's just a bug in my code. As always macro are bad for this kind of things and this time I've learned the lesson. Thanks for participation.