Don't use MessageBox() for this purpose. Instead, use OutputDebugString() to output diagnostic messages.

The reason why MessageBox() shouldn't be used, and probably the reason why you are...